commit d52e934c24c9d327e277eb60bfee060697cb43ec Author: Damian Johnson atagar@torproject.org Date: Mon Jul 9 11:52:56 2012 -0700
Only consulting major descriptor versions
Minor descriptor version bumps are backward compatable changes. We might not recognize new additions, but it won't break us either (they'll just be unrecognized). Pointed out by Karsten on... https://trac.torproject.org/6257 --- stem/descriptor/__init__.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/stem/descriptor/__init__.py b/stem/descriptor/__init__.py index f3b40c5..bb6f874 100644 --- a/stem/descriptor/__init__.py +++ b/stem/descriptor/__init__.py @@ -81,13 +81,13 @@ def parse_file(path, descriptor_file): desc_type, major_version, minor_version = metrics_header_match.groups() major_version, minor_version = int(major_version), int(minor_version)
- if desc_type == "server-descriptor" and major_version == 1 and minor_version == 0: + if desc_type == "server-descriptor" and major_version == 1: desc = stem.descriptor.server_descriptor.RelayDescriptor(descriptor_file.read()) - elif desc_type == "bridge-server-descriptor" and major_version == 1 and minor_version == 0: + elif desc_type == "bridge-server-descriptor" and major_version == 1: desc = stem.descriptor.server_descriptor.BridgeDescriptor(descriptor_file.read()) - elif desc_type == "extra-info" and major_version == 1 and minor_version == 0: + elif desc_type == "extra-info" and major_version == 1: desc = stem.descriptor.extrainfo_descriptor.RelayExtraInfoDescriptor(descriptor_file.read()) - elif desc_type == "bridge-extra-info" and major_version == 1 and minor_version in (0, 1): + elif desc_type == "bridge-extra-info" and major_version == 1: # version 1.1 introduced a 'transport' field... # https://trac.torproject.org/6257
tor-commits@lists.torproject.org