aboutsummaryrefslogtreecommitdiff
path: root/scripts/csvgrep.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-04-25 13:53:18 +0000
committerRob Austein <sra@hactrn.net>2012-04-25 13:53:18 +0000
commit5c03bbdc8dc2a94e92384e0a2cd28cc9dd8e313b (patch)
tree0bef754a8ced8058adf7f6567541b5e041f76ea5 /scripts/csvgrep.py
parent5164817d379145baef44650e6506be7f80cd1b15 (diff)
Clean up old scripts which still imported the rpki.myrpki module.
svn path=/trunk/; revision=4454
Diffstat (limited to 'scripts/csvgrep.py')
-rw-r--r--scripts/csvgrep.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/csvgrep.py b/scripts/csvgrep.py
index 8a680a99..66fd4c4f 100644
--- a/scripts/csvgrep.py
+++ b/scripts/csvgrep.py
@@ -13,7 +13,7 @@ any ASNs given, and prefixes.csv for any prefixes given.
$Id$
-Copyright (C) 2010 Internet Systems Consortium ("ISC")
+Copyright (C) 2010-2012 Internet Systems Consortium ("ISC")
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -28,11 +28,13 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
"""
-import sys, rpki.resource_set, rpki.myrpki
+import sys
+from rpki.resource_set import resource_set_as, resource_set_ipv4, resource_set_ipv6
+from rpki.csv_utils import csv_reader
-asn = rpki.resource_set.resource_set_as()
-ipv4 = rpki.resource_set.resource_set_ipv4()
-ipv6 = rpki.resource_set.resource_set_ipv6()
+asn = resource_set_as()
+ipv4 = resource_set_ipv4()
+ipv6 = resource_set_ipv6()
for datum in sys.argv[1:]:
if datum.replace("-", "").isdigit():
@@ -57,13 +59,13 @@ def matches(set1, datum):
return False
if asn:
- for h, a in rpki.myrpki.csv_reader("asns.csv", columns = 2):
+ for h, a in csv_reader("asns.csv", columns = 2):
m = matches(asn, a)
if m:
print h, m
if ipv4 or ipv6:
- for h, a in rpki.myrpki.csv_reader("prefixes.csv", columns = 2):
+ for h, a in csv_reader("prefixes.csv", columns = 2):
t = ipv6 if ":" in a else ipv4
m = t and matches(t, a)
if m: