Use black as formatter for python files
This commit is contained in:
parent
0d25aff744
commit
493fc60401
57 changed files with 915 additions and 900 deletions
|
@ -1,18 +1,19 @@
|
|||
from circuits.models import Provider
|
||||
from startup_script_utils import *
|
||||
import sys
|
||||
|
||||
providers = load_yaml('/opt/netbox/initializers/providers.yml')
|
||||
from circuits.models import Provider
|
||||
from startup_script_utils import load_yaml, pop_custom_fields, set_custom_fields_values
|
||||
|
||||
providers = load_yaml("/opt/netbox/initializers/providers.yml")
|
||||
|
||||
if providers is None:
|
||||
sys.exit()
|
||||
sys.exit()
|
||||
|
||||
for params in providers:
|
||||
custom_field_data = pop_custom_fields(params)
|
||||
custom_field_data = pop_custom_fields(params)
|
||||
|
||||
provider, created = Provider.objects.get_or_create(**params)
|
||||
provider, created = Provider.objects.get_or_create(**params)
|
||||
|
||||
if created:
|
||||
set_custom_fields_values(provider, custom_field_data)
|
||||
if created:
|
||||
set_custom_fields_values(provider, custom_field_data)
|
||||
|
||||
print("📡 Created provider", provider.name)
|
||||
print("📡 Created provider", provider.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue