[tor-commits] [bridgedb/master] Use correct loglevel and skip inactive bridges.

aagbsn at torproject.org aagbsn at torproject.org
Sat Jun 22 17:17:06 UTC 2013


commit 6f12c3aad44ef51fbf38baa1470b143037891718
Author: aagbsn <aagbsn at extc.org>
Date:   Sat Jun 22 19:18:20 2013 +0200

    Use correct loglevel and skip inactive bridges.
---
 lib/bridgedb/Main.py      |    9 +++++----
 lib/bridgedb/Stability.py |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index c9c7fbd..9f09b7f 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -192,10 +192,11 @@ def load(cfg, splitter, clear=False):
             # XXX: what do we do with all these or_addresses?
             # The bridge stability metrics are only concerned with a single ip:port
             # So for now, we will only consider the bridges primary IP:port
-            ts = timestamps[bridge.getID()][:]
-            ts.sort()
-            for timestamp in ts:
-                bridgedb.Stability.addOrUpdateBridgeHistory(bridge, timestamp)
+	    if bridge.getID() in timestamps.keys():
+            	ts = timestamps[bridge.getID()][:]
+            	ts.sort()
+            	for timestamp in ts:
+            	    bridgedb.Stability.addOrUpdateBridgeHistory(bridge, timestamp)
         f.close()
     # read pluggable transports from extra-info document
     # XXX: should read from networkstatus after bridge-authority
diff --git a/lib/bridgedb/Stability.py b/lib/bridgedb/Stability.py
index a86f853..5cd7e8e 100644
--- a/lib/bridgedb/Stability.py
+++ b/lib/bridgedb/Stability.py
@@ -184,7 +184,7 @@ def addOrUpdateBridgeHistory(bridge, timestamp):
     bhe = db.getBridgeHistory(bridge.fingerprint)
 
     if not bridge.running:
-        log.notice("%s is not running" % bridge.fingerprint)
+        logging.info("%s is not running" % bridge.fingerprint)
         return bhe
 
     # Parse the descriptor and see if the address or port changed



More information about the tor-commits mailing list