[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Stripping off the 'opt ' keyline prefix



commit 47f21c97da50392d4d0be38d7292bca920d716df
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Mar 18 14:39:13 2012 -0700

    Stripping off the 'opt ' keyline prefix
---
 stem/descriptor/server_descriptor.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py
index d0f343c..2b92f5c 100644
--- a/stem/descriptor/server_descriptor.py
+++ b/stem/descriptor/server_descriptor.py
@@ -94,7 +94,13 @@ class ServerDescriptorV2(Descriptor):
     exit_policy_lines = []
     
     for line in contents.split("\n"):
-      line_match = KEYWORD_LINE.match()
+      # Some lines have an 'opt ' for backward compatability. They should be
+      # ignored. This prefix is being removed in...
+      # https://trac.torproject.org/projects/tor/ticket/5419
+      
+      line = line.lstrip("opt ")
+      
+      line_match = KEYWORD_LINE.match(line)
       
       if not line_match:
         raise ValueError("Line contains invalid characters: %s" % line)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits