Merge lp://qastaging/~cmiller/desktopcouch/fix-resolver into lp://qastaging/desktopcouch

Proposed by Chad Miller
Status: Merged
Approved by: dobey
Approved revision: 10
Merged at revision: not available
Proposed branch: lp://qastaging/~cmiller/desktopcouch/fix-resolver
Merge into: lp://qastaging/desktopcouch
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~cmiller/desktopcouch/fix-resolver
Reviewer Review Type Date Requested Status
dobey (community) Approve
John O'Brien (community) Approve
Review via email: mp+9057@code.qastaging.launchpad.net

Commit message

[r=jdobrien, r=dobey] If the name of an address is unknown, then the resolver should return the same address, which is better than nothing and still unambiguous.

To post a comment you must log in.
Revision history for this message
Chad Miller (cmiller) wrote :

Don't hork if DBus+Avahi doesn't know the address of the remote end.

Revision history for this message
John O'Brien (jdobrien) wrote :

Looks good to me.

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktopcouch/pair/couchdb_pairing/dbus_io.py'
2--- desktopcouch/pair/couchdb_pairing/dbus_io.py 2009-07-10 22:13:01 +0000
3+++ desktopcouch/pair/couchdb_pairing/dbus_io.py 2009-07-20 14:34:08 +0000
4@@ -34,9 +34,13 @@
5 """Look up the name of a host by its address. This is like DNS
6 PTR in-arpa, but all zeroconf-y."""
7 bus, server = get_dbus_bus_server()
8- interface, protocol, aprotocol, address, hostname, flags = \
9- server.ResolveAddress(iface, avahi.PROTO_UNSPEC,
10- ip_address_as_ascii, dbus.UInt32(0))
11+ try:
12+ interface, protocol, aprotocol, address, hostname, flags = \
13+ server.ResolveAddress(iface, avahi.PROTO_UNSPEC,
14+ ip_address_as_ascii, dbus.UInt32(0))
15+ except dbus.exceptions.DBusException:
16+ return ip_address_as_ascii
17+
18 return hostname
19
20 def get_dbus_bus_server():

Subscribers

People subscribed via source and target branches