import script fixes for current db

This commit is contained in:
Sebastian Lohff 2017-04-15 16:49:27 +02:00
parent 429a772f57
commit 48499d9436
1 changed files with 6 additions and 4 deletions

View File

@ -38,9 +38,8 @@ def main():
parser = _parser()
args = parser.parse_args()
defContact = Contact.objects.get(handle="DURC1-DN")
defContact
defMnt = Maintainer.objects.get(handle="DARK1-MNT")
defContact = Contact.objects.get(handle="UNKNOWN-DN")
defMnt = Maintainer.objects.get(handle="DARKNET-MNT")
blocks = [
ASBlock.objects.get(handle="TRA1-ASB"),
ASBlock.objects.get(handle="UAB1-ASB")
@ -49,7 +48,8 @@ def main():
InetNum.objects.get(handle="TRA1-NET"),
InetNum.objects.get(handle="DEF4-NET"),
InetNum.objects.get(handle="DEF6-NET"),
InetNum.objects.get(handle="UNR1-NET"),
InetNum.objects.get(handle="MISC6-NET"),
InetNum.objects.get(handle="LTRA1-NET"),
InetNum.objects.get(handle="MAIN4-NET"),
]
@ -82,6 +82,7 @@ def main():
obj.description = "Object has been imported from old DB and has not yet been edited"
obj.save()
obj.mnt_by.add(defMnt)
obj.admin_c.add(defContact)
obj.save()
for net in data["network"]:
@ -117,6 +118,7 @@ def main():
obj.save()
obj.mnt_by.add(defMnt)
obj.admin_c.add(defContact)
if origin:
obj.origin_as.add(origin)
obj.save()