[tor-commits] [bridgedb/master] 5935 - Use bridge.ip when logging r.insert(bridge)

aagbsn at torproject.org aagbsn at torproject.org
Sat Mar 16 23:46:31 UTC 2013


commit d6605fa9c739b4499bd20d28e3dc2c63d1cc7086
Author: aagbsn <aagbsn at extc.org>
Date:   Wed Jun 13 20:34:24 2012 -0700

    5935 - Use bridge.ip when logging r.insert(bridge)
    
    BridgeRing.insert() logging.debug now uses the primary bridge address
    (bridge.ip) to avoid the case where a bridge has no IPv4 addresses,
    when running python setup.py tests, for example.
---
 lib/bridgedb/Bridges.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index 5c60209..5a3949a 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -504,7 +504,10 @@ class BridgeRing(BridgeHolder):
             self.isSorted = False
         self.bridges[pos] = bridge
         self.bridgesByID[ident] = bridge
-        logging.debug("Adding %s to %s", bridge.getConfigLine(True), self.name)
+        #XXX: just use bridge.ip
+        if isinstance(bridge.ip, ipaddr.IPv6Address): ip = "[%s]" % bridge.ip
+        else: ip = bridge.ip
+        logging.debug("Adding %s to %s", ip, self.name)
 
     def _sort(self):
         """Helper: put the keys in sorted order."""





More information about the tor-commits mailing list