aws_info_helper/__init__.py
def do_ssh(ip, pem_file, user, command='', timeout=None, verbose=False):
    """Actually SSH to a server

    - ip: IP address
    - pem_file: absolute path to pem file
    - user: remote SSH user
    - command: an optional command to run on the remote server
        - if a command is specified, it will be run on the remote server and
          the output will be returned
        - if no command is specified, the SSH session will be interactive
    """
    ssh_command = 'ssh -i {} -o "StrictHostKeyChecking no" -o ConnectTimeout=2 {}@{}'
    cmd = ssh_command.format(pem_file, user, ip)
    if command:
        cmd = cmd + ' -t {}'.format(repr(command))
    if verbose:
        print(cmd)

    result = None
    if command:
        result = bh.run_output(cmd, timeout=timeout)
        if verbose:
            print(result)
    else:
        result = bh.run(cmd)
    return result
Actually SSH to a server

    - ip: IP address
    - pem_file: absolute path to pem file
    - user: remote SSH user
    - command: an optional command to run on the remote server
        - if a command is specified, it will be run on the remote server and
          the output will be returned
        - if no command is specified, the SSH session will be interactive
    
Actually SSH to a server
ip: IP address
pem_file: absolute path to pem file
user: remote SSH user
command: an optional command to run on the remote server
if a command is specified, it will be run on the remote server and
the output will be returned
if no command is specified, the SSH session will be interactive
Actually SSH to a server ip : IP address pem_file : absolute path to pem file user : remote SSH user command : an optional command to run on the remote server if a command is specified it will be run on the remote server and the output will be returned if no command is specified the SSH session will be interactive
def do_ssh(ip, pem_file, user, command='', timeout=None, verbose=False):
    ssh_command = 'ssh -i {} -o "StrictHostKeyChecking no" -o ConnectTimeout=2 {}@{}'
    cmd = ssh_command.format(pem_file, user, ip)
    if command:
        cmd = cmd + ' -t {}'.format(repr(command))
    if verbose:
        print(cmd)
    result = None
    if command:
        result = bh.run_output(cmd, timeout=timeout)
        if verbose:
            print(result)
    else:
        result = bh.run(cmd)
    return result
def do_ssh ( ip , pem_file , user , command = '' , timeout = None , verbose = False ) : ssh_command = 'ssh -i {} -o "StrictHostKeyChecking no" -o ConnectTimeout=2 {}@{}' cmd = ssh_command . format ( pem_file , user , ip ) if command : cmd = cmd + ' -t {}' . format ( repr ( command ) ) if verbose : print ( cmd ) result = None if command : result = bh . run_output ( cmd , timeout = timeout ) if verbose : print ( result ) else : result = bh . run ( cmd ) return result
Actually SSH to a server
 ip: IP address
 pem_file: absolute path to pem file
 user: remote SSH user
 command: an optional command to run on the remote server
 if a command is specified, it will be run on the remote server and
the output will be returned
 if no command is specified, the SSH session will be interactive
Actually SSH to a server ip : IP address pem_file : absolute path to pem file user : remote SSH user command : an optional command to run on the remote server if a command is specified it will be run on the remote server and the output will be returned if no command is specified the SSH session will be interactive
"""Actually SSH to a server

    - ip: IP address
    - pem_file: absolute path to pem file
    - user: remote SSH user
    - command: an optional command to run on the remote server
        - if a command is specified, it will be run on the remote server and
          the output will be returned
        - if no command is specified, the SSH session will be interactive
    """
ip
pem_file
user
command
timeout
verbose