Opened 8 years ago

Closed 8 years ago

#7261 defect closed duplicate (duplicate)


Reported by: Adi Roiban Owned by: Adi Roiban
Priority: normal Milestone:
Component: conch Keywords:
Cc: z3p Branch:


getPeer has this strange code.

return('SSH', )+self.conn.transport.getPeer()

The error is

   return('SSH', )+self.conn.transport.getPeer()

exceptions.TypeError: can only concatenate tuple (not "SSHTransportAddress") to tuple
(Pdb) self.conn.transport.getPeer()
SSHTransportAddress(IPv4Address(TCP, '', 35447))

(Pdb) self.conn.transport.getPeer().address
IPv4Address(TCP, '', 35447)

There is a test for the code, but it using mocked a transport which returns a tupple with a single value!?!

This is why this test passed when SSHTransport was changed in #2997

The current transport returns a SSHTransportAddress.

I have no why a SSHTransportAddress object is required and why an IPv4Address is not enough.

It looks like SSHTransportAddress was introduced in 12.1 by Paul Swartz in #2997 but the review / patch contains no hint about why that object is needed.

I can try to fix this but I have no idea why SSHSession.getPeer should return a tupple and not in IAddress ... and also why SSHTranport.getPeer is returning an IAddress wrapped inside another IAddress.


Change History (2)

comment:1 Changed 8 years ago by DefaultCC Plugin

Cc: z3p added

comment:2 Changed 8 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

Thanks. Sadly, duplicate of #5999.

Note: See TracTickets for help on using tickets.