Import script lang fixes

This commit is contained in:
Sebastian Lohff 2017-03-28 13:00:08 +02:00
parent 65e92b38dc
commit 9e241adb8e
1 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse import argparse
import json import json
@ -74,7 +73,7 @@ def main():
if len(asn['admin_c']) >= 1: if len(asn['admin_c']) >= 1:
name = data["handles"][asn["admin_c"][0]]["person"] name = data["handles"][asn["admin_c"][0]]["person"]
obj.name = "Imported AS from %s" % name obj.name = "Imported AS of %s" % name
obj.handle = ASNumber.genGenericHandle(re.sub("[^a-zA-Z0-9 ]", "", name)) obj.handle = ASNumber.genGenericHandle(re.sub("[^a-zA-Z0-9 ]", "", name))
else: else:
obj.name = "Imported AS without admin info" obj.name = "Imported AS without admin info"
@ -100,7 +99,7 @@ def main():
x = list(filter(lambda _x: _x['number'] == net["origin"], data["as"])) x = list(filter(lambda _x: _x['number'] == net["origin"], data["as"]))
if len(x) > 0 and x[0]["admin_c"]: if len(x) > 0 and x[0]["admin_c"]:
name = data["handles"][x[0]["admin_c"][0]]["person"] name = data["handles"][x[0]["admin_c"][0]]["person"]
obj.name = "Imported Network from %s" % name obj.name = "Imported Network of %s" % name
obj.handle = InetNum.genGenericHandle(re.sub("[^a-zA-Z0-9 ]", "", name)) obj.handle = InetNum.genGenericHandle(re.sub("[^a-zA-Z0-9 ]", "", name))
else: else:
obj.name = "Imported Network without admin info" obj.name = "Imported Network without admin info"