Change logic to prevent sys.exit from stopping script processing

This commit is contained in:
Hank Preston 2020-05-06 13:25:09 -04:00
parent 5769684c98
commit 5292afaae0
28 changed files with 544 additions and 572 deletions

View file

@ -4,11 +4,10 @@ import sys
rirs = load_yaml('/opt/netbox/initializers/rirs.yml')
if rirs is None:
sys.exit()
if not rirs is None:
for params in rirs:
rir, created = RIR.objects.get_or_create(**params)
for params in rirs:
rir, created = RIR.objects.get_or_create(**params)
if created:
print("🗺️ Created RIR", rir.name)
if created:
print("🗺️ Created RIR", rir.name)