All pastes #344557 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-07 21:02 UTC
rendered paste body
def get_transport(socket):
        """
        Get transport.
        """
        try:
                t = paramiko.Transport(socket)
                t.start_client()
        except paramiko.SSHException:
                print 'Secure Shell negotiation failed.'
                traceback.print_exc()
                sys.exit(1)


Here is it being called:

        mysock = ssh_connect(hostname, port)
        get_transport(mysock)

        try:
                t = paramiko.Transport(mysock)
                t.start_client()
        except paramiko.SSHException:
                print 'Secure Shell negotiation failed.'
                sys.exit(1)


I get this:

$ python pssh.py 
Secure Shell negotiation failed.