mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-08-09 08:05:08 +02:00
Increase order prefix to 3 digits
This commit is contained in:
14
startup_scripts/050_manufacturers.py
Normal file
14
startup_scripts/050_manufacturers.py
Normal file
@ -0,0 +1,14 @@
|
||||
from dcim.models import Manufacturer
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
with open('/opt/netbox/initializers/manufacturers.yml', 'r') as stream:
|
||||
yaml = YAML(typ='safe')
|
||||
manufacturers = yaml.load(stream)
|
||||
|
||||
if manufacturers is not None:
|
||||
for params in manufacturers:
|
||||
manufacturer, created = Manufacturer.objects.get_or_create(**params)
|
||||
|
||||
if created:
|
||||
print("Created Manufacturer", manufacturer.name)
|
||||
|
Reference in New Issue
Block a user