[tor-commits] [metrics-tasks/master] Accept "AS"-prefixed ASes or just AS numbers (#6329).

karsten at torproject.org karsten at torproject.org
Fri Jul 20 14:00:01 UTC 2012


commit a0a2e0e0900832f78ce14d13fd5fa41417562717
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Jul 20 15:48:20 2012 +0200

    Accept "AS"-prefixed ASes or just AS numbers (#6329).
---
 task-6329/tor-relays-stats.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/task-6329/tor-relays-stats.py b/task-6329/tor-relays-stats.py
index fc9b14c..09bf98a 100755
--- a/task-6329/tor-relays-stats.py
+++ b/task-6329/tor-relays-stats.py
@@ -27,6 +27,8 @@ class RelayStats(object):
         relays = []
         if countries:
             countries = [x.lower() for x in countries]
+        if as_sets:
+            as_sets = [x if not x.isdigit() else "AS" + x for x in as_sets]
         for relay in self.data['relays']:
             if not relay['running']:
                 continue





More information about the tor-commits mailing list