[Twisted-Python] getPeer() inside conch

Paul Swartz paulswartz at gmail.com
Fri Oct 2 11:28:16 MDT 2009


On Thu, Oct 1, 2009 at 10:53 PM, Glyph Lefkowitz
<glyph at twistedmatrix.com> wrote:
> On Thu, Oct 1, 2009 at 10:21 PM, Benjamin Rutt <rutt.4 at osu.edu> wrote:
>>
>> (A/B) it looks like the SSHChannel implementation of getPeer() is faulty.
>> If I change my two-line implementation of getPeer() inside
>> SSHSessionProcessProtocol to simply 'return self.session.getPeer()', I get:
>>   File
>> "/home/ruttbe/dev/python/twisted-8.2.0-inst/lib/python/twisted/conch/ssh/session.py",
>> line 216, in getPeer
>>     return self.session.getPeer()
>>   File
>> "/home/ruttbe/dev/python/twisted-8.2.0-inst/lib/python/twisted/conch/ssh/channel.py",
>> line 261, in getPeer
>>     return('SSH', )+self.conn.transport.getPeer()
>> AttributeError: SSHServerTransport instance has no attribute 'getPeer'
>
> OK, I give up :).  Looks like that is pretty clearly a bug, though.

You're correct; it's bug http://twistedmatrix.com/trac/ticket/2997

There's also http://twistedmatrix.com/trac/ticket/2453 for adding
getHost()/getPeer() to SSHSessionProcessProtocol.

A patch should probably be against
branches/conch-old-session-tests-4047, which already includes tests
for other things in twisted/conch/ssh/session.py

-p
-- 
Paul Swartz
paulswartz at gmail dot com
http://paulswartz.net/
AIM: z3penguin




More information about the Twisted-Python mailing list