Change logic to prevent sys.exit from stopping script processing
This commit is contained in:
parent
5769684c98
commit
5292afaae0
28 changed files with 544 additions and 572 deletions
|
@ -4,11 +4,10 @@ import sys
|
|||
|
||||
tenant_groups = load_yaml('/opt/netbox/initializers/tenant_groups.yml')
|
||||
|
||||
if tenant_groups is None:
|
||||
sys.exit()
|
||||
if not tenant_groups is None:
|
||||
|
||||
for params in tenant_groups:
|
||||
tenant_group, created = TenantGroup.objects.get_or_create(**params)
|
||||
for params in tenant_groups:
|
||||
tenant_group, created = TenantGroup.objects.get_or_create(**params)
|
||||
|
||||
if created:
|
||||
print("🔳 Created Tenant Group", tenant_group.name)
|
||||
if created:
|
||||
print("🔳 Created Tenant Group", tenant_group.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue