correct circuit model startup scripts
This commit is contained in:
parent
6ab38472be
commit
31f52041f8
|
@ -1,6 +1,6 @@
|
||||||
# - name: VPLS
|
- name: VPLS
|
||||||
# slug: vpls
|
slug: vpls
|
||||||
# - name: MPLS
|
- name: MPLS
|
||||||
# slug: mpls
|
slug: mpls
|
||||||
# - name: Internet
|
- name: Internet
|
||||||
# slug: internet
|
slug: internet
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# - cid: Circuit_ID-1
|
# - cid: Circuit_ID-1
|
||||||
# provider: Provider1
|
# provider: Provider1
|
||||||
# type: Internet
|
# type: Internet
|
||||||
# - name: Circuit_ID-2
|
# - cid: Circuit_ID-2
|
||||||
# provider: Provider2
|
# provider: Provider2
|
||||||
# type: MPLS
|
# type: MPLS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# - name: Provider1
|
- name: Provider1
|
||||||
# slug: provider1
|
slug: provider1
|
||||||
# asn: 121
|
asn: 121
|
||||||
# - name: Provider2
|
- name: Provider2
|
||||||
# slug: provider2
|
slug: provider2
|
||||||
# asn: 122
|
asn: 122
|
||||||
|
|
|
@ -13,6 +13,6 @@ for params in providers:
|
||||||
provider, created = Provider.objects.get_or_create(**params)
|
provider, created = Provider.objects.get_or_create(**params)
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
set_custom_fields_values(name, custom_field_data)
|
set_custom_fields_values(provider, custom_field_data)
|
||||||
|
|
||||||
print("📡 Created provider", provider.name)
|
print("📡 Created provider", provider.name)
|
||||||
|
|
|
@ -13,6 +13,6 @@ for params in circuit_types:
|
||||||
circuit_type, created = CircuitType.objects.get_or_create(**params)
|
circuit_type, created = CircuitType.objects.get_or_create(**params)
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
set_custom_fields_values(name, custom_field_data)
|
set_custom_fields_values(circuit_type, custom_field_data)
|
||||||
|
|
||||||
print("⚡ Created Circuit Type", circuit_type.name)
|
print("⚡ Created Circuit Type", circuit_type.name)
|
||||||
|
|
|
@ -9,7 +9,7 @@ if circuits is None:
|
||||||
|
|
||||||
required_assocs = {
|
required_assocs = {
|
||||||
'provider': (Provider, 'name'),
|
'provider': (Provider, 'name'),
|
||||||
'circuit_type': (CircuitType, 'name')
|
'type': (CircuitType, 'name')
|
||||||
}
|
}
|
||||||
|
|
||||||
for params in circuits:
|
for params in circuits:
|
||||||
|
@ -24,6 +24,6 @@ for params in circuits:
|
||||||
circuit, created = Circuit.objects.get_or_create(**params)
|
circuit, created = Circuit.objects.get_or_create(**params)
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
set_custom_fields_values(cid, custom_field_data)
|
set_custom_fields_values(circuit, custom_field_data)
|
||||||
|
|
||||||
print("⚡ Created Circuit", circuit.cid)
|
print("⚡ Created Circuit", circuit.cid)
|
||||||
|
|
Loading…
Reference in New Issue