mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2024-11-29 11:23:09 +01:00
19 lines
442 B
Python
19 lines
442 B
Python
|
from circuits.models import Provider
|
||
|
from startup_script_utils import *
|
||
|
import sys
|
||
|
|
||
|
providers = load_yaml('/opt/netbox/initializers/providers.yml')
|
||
|
|
||
|
if providers is None:
|
||
|
sys.exit()
|
||
|
|
||
|
for params in providers:
|
||
|
custom_field_data = pop_custom_fields(params)
|
||
|
|
||
|
provider, created = Provider.objects.get_or_create(**params)
|
||
|
|
||
|
if created:
|
||
|
set_custom_fields_values(name, custom_field_data)
|
||
|
|
||
|
print("📡 Created provider", provider.name)
|