mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2024-12-14 02:31:11 +01:00
50ade7bce1
This commit starts to remove some code redundancy from the startup scripts for easier maintenance.
15 lines
300 B
Python
15 lines
300 B
Python
from ipam.models import RIR
|
|
from startup_script_utils import load_yaml
|
|
import sys
|
|
|
|
rirs = load_yaml('/opt/netbox/initializers/rirs.yml')
|
|
|
|
if rirs is None:
|
|
sys.exit()
|
|
|
|
for params in rirs:
|
|
rir, created = RIR.objects.get_or_create(**params)
|
|
|
|
if created:
|
|
print("🗺️ Created RIR", rir.name)
|