Merge lp:~spiv/ubuntu/lucid/paramiko/address-families-579530-lucid into lp:ubuntu/lucid/paramiko

Proposed by Andrew Bennetts
Status: Work in progress
Proposed branch: lp:~spiv/ubuntu/lucid/paramiko/address-families-579530-lucid
Merge into: lp:ubuntu/lucid/paramiko
Diff against target: 44 lines (+17/-4)
2 files modified
debian/changelog (+7/-0)
paramiko/transport.py (+10/-4)
To merge this branch: bzr merge lp:~spiv/ubuntu/lucid/paramiko/address-families-579530-lucid
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+25297@code.launchpad.net

Description of the change

Fix bug 579530, which is affecting bzr.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

So, this looks ok to me. Its in main, which means I can't apply it. paramiko has simple-patchsys included, but the patch should be applied precisely by upstream, so I don't really care either way about how the change is recorded. Viva le VCS.

review: Approve

Unmerged revisions

13. By Andrew Bennetts

Apply proposed fix for LP: #579530.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-12-16 08:15:36 +0000
3+++ debian/changelog 2010-05-14 07:52:29 +0000
4@@ -1,3 +1,10 @@
5+paramiko (1.7.6-2ubuntu1) lucid; urgency=low
6+
7+ * Try connecting to each available address family until one succeeds.
8+ (LP: #579530)
9+
10+ -- Andrew Bennetts <andrew.bennetts@canonical.com> Fri, 14 May 2010 09:41:51 +0200
11+
12 paramiko (1.7.6-2) unstable; urgency=low
13
14 * debian/control: Fix last remaining lintian warning
15
16=== modified file 'paramiko/transport.py'
17--- paramiko/transport.py 2009-12-16 08:15:36 +0000
18+++ paramiko/transport.py 2010-05-14 07:52:29 +0000
19@@ -285,15 +285,21 @@
20 if type(sock) is tuple:
21 # connect to the given (host, port)
22 hostname, port = sock
23+ reason = 'No suitable address family'
24 for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM):
25 if socktype == socket.SOCK_STREAM:
26 af = family
27 addr = sockaddr
28- break
29+ sock = socket.socket(af, socket.SOCK_STREAM)
30+ try:
31+ sock.connect((hostname, port))
32+ except socket.error, e:
33+ reason = str(e)
34+ else:
35+ break
36 else:
37- raise SSHException('No suitable address family for %s' % hostname)
38- sock = socket.socket(af, socket.SOCK_STREAM)
39- sock.connect((hostname, port))
40+ raise SSHException(
41+ 'Unable to connect to %s: %s' % (hostname, reason))
42 # okay, normal socket-ish flow here...
43 threading.Thread.__init__(self)
44 self.setDaemon(True)

Subscribers

People subscribed via source and target branches

to all changes: