[tor-commits] [stem/master] Populating BridgeNetworkStatusDocuments with v2 entries

atagar at torproject.org atagar at torproject.org
Thu Jan 24 17:26:32 UTC 2013


commit 7921a46ba8655baa7c4b81d900a9854444675564
Author: Damian Johnson <atagar at torproject.org>
Date:   Thu Jan 24 09:21:35 2013 -0800

    Populating BridgeNetworkStatusDocuments with v2 entries
    
    Karsten reports that bridge network status documents have v2 router status
    entries, not v3.
    
    https://trac.torproject.org/8036
---
 stem/descriptor/networkstatus.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py
index a7993c9..c1bbadf 100644
--- a/stem/descriptor/networkstatus.py
+++ b/stem/descriptor/networkstatus.py
@@ -213,7 +213,7 @@ def _parse_file(document_file, document_type = None, validate = True, is_microde
       router_type = stem.descriptor.router_status_entry.RouterStatusEntryMicroV3
   elif document_type == BridgeNetworkStatusDocument:
     document_type = BridgeNetworkStatusDocument
-    router_type = stem.descriptor.router_status_entry.RouterStatusEntryV3
+    router_type = stem.descriptor.router_status_entry.RouterStatusEntryV2
   else:
     raise ValueError("Document type %i isn't recognized (only able to parse v2, v3, and bridge)" % document_type)
 
@@ -1339,7 +1339,7 @@ class BridgeNetworkStatusDocument(NetworkStatusDocument):
   Network status document containing bridges. This is only available through
   the metrics site.
 
-  :var tuple routers: :class:`~stem.descriptor.router_status_entry.RouterStatusEntryV3`
+  :var tuple routers: :class:`~stem.descriptor.router_status_entry.RouterStatusEntryV2`
     contained in the document
   :var datetime published: time when the document was published
   """
@@ -1368,6 +1368,6 @@ class BridgeNetworkStatusDocument(NetworkStatusDocument):
     self.routers = tuple(stem.descriptor.router_status_entry._parse_file(
       document_file,
       validate,
-      entry_class = stem.descriptor.router_status_entry.RouterStatusEntryV3,
+      entry_class = stem.descriptor.router_status_entry.RouterStatusEntryV2,
       extra_args = (self,),
     ))



More information about the tor-commits mailing list