I understand that. The problem I'm facing is that unless I write "reactor.run()" my client isn't starting up. From what I understood in the trial documentation, I should simply call the connectTCP method and then return a deferred. However, if I do that, the client isn't starting. I'll post some of the client code for you info : class SimpleTransport(transport.SSHClientTransport): def verifyHostKey(self, hostKey, fingerprint): print 'host key fingerprint: %s' % fingerprint return defer.succeed(1)
def connectionSecure(self): self.requestService( SimpleUserAuth('webchick', SimpleConnection())) class SimpleUserAuth(userauth.SSHUserAuthClient): def getPassword(self): return defer.succeed("Thai1mil3ahb") def getPublicKey(self): print "trying public key" path = os.path.expanduser('~/.ssh/id_rsa') # this works with rsa too # just change the name here and in getPrivateKey if not os.path.exists(path) or self.lastPublicKey: # the file doesn't exist, or we've tried a public key return return keys.Key.fromFile(filename=path+'.pub',passphrase='pikachu').blob() def getPrivateKey(self): path = os.path.expanduser('~/.ssh/id_rsa') return defer.succeed(keys.Key.fromFile(path,passphrase='pikachu').keyObject) Now , in my test case : def test_1(self): def got_data(data): self.assertEquals(data,"a") d = protocol.ClientCreator(reactor, SimpleTransport).connectTCP('localhost', self.server.getHost().port) d.addCallback(got_data) return d The callback is firing, but the client is not started and *data* is a SimpleTransport Instance. Any thoughts on why this is happening and what I am doing wrong?
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python