From 31f52041f87e6f5cd412a06fdfeeb320197a3d86 Mon Sep 17 00:00:00 2001 From: ryanmerolle Date: Tue, 29 Dec 2020 18:27:41 -0500 Subject: [PATCH] correct circuit model startup scripts --- initializers/circuit_types.yml | 12 ++++++------ initializers/circuits.yml | 2 +- initializers/providers.yml | 12 ++++++------ startup_scripts/280_providers.py | 2 +- startup_scripts/290_circuit_types.py | 2 +- startup_scripts/300_circuits.py | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/initializers/circuit_types.yml b/initializers/circuit_types.yml index 0e9c356..95dee30 100644 --- a/initializers/circuit_types.yml +++ b/initializers/circuit_types.yml @@ -1,6 +1,6 @@ -# - name: VPLS -# slug: vpls -# - name: MPLS -# slug: mpls -# - name: Internet -# slug: internet +- name: VPLS + slug: vpls +- name: MPLS + slug: mpls +- name: Internet + slug: internet diff --git a/initializers/circuits.yml b/initializers/circuits.yml index 44e0a3a..93b4659 100644 --- a/initializers/circuits.yml +++ b/initializers/circuits.yml @@ -1,6 +1,6 @@ # - cid: Circuit_ID-1 # provider: Provider1 # type: Internet -# - name: Circuit_ID-2 +# - cid: Circuit_ID-2 # provider: Provider2 # type: MPLS diff --git a/initializers/providers.yml b/initializers/providers.yml index ca2ca1a..4d0e5b0 100644 --- a/initializers/providers.yml +++ b/initializers/providers.yml @@ -1,6 +1,6 @@ -# - name: Provider1 -# slug: provider1 -# asn: 121 -# - name: Provider2 -# slug: provider2 -# asn: 122 +- name: Provider1 + slug: provider1 + asn: 121 +- name: Provider2 + slug: provider2 + asn: 122 diff --git a/startup_scripts/280_providers.py b/startup_scripts/280_providers.py index 393d5ed..e927dda 100644 --- a/startup_scripts/280_providers.py +++ b/startup_scripts/280_providers.py @@ -13,6 +13,6 @@ for params in providers: provider, created = Provider.objects.get_or_create(**params) if created: - set_custom_fields_values(name, custom_field_data) + set_custom_fields_values(provider, custom_field_data) print("📡 Created provider", provider.name) diff --git a/startup_scripts/290_circuit_types.py b/startup_scripts/290_circuit_types.py index b6dca6c..441f059 100644 --- a/startup_scripts/290_circuit_types.py +++ b/startup_scripts/290_circuit_types.py @@ -13,6 +13,6 @@ for params in circuit_types: circuit_type, created = CircuitType.objects.get_or_create(**params) 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) diff --git a/startup_scripts/300_circuits.py b/startup_scripts/300_circuits.py index 3d2bf24..456c792 100644 --- a/startup_scripts/300_circuits.py +++ b/startup_scripts/300_circuits.py @@ -9,7 +9,7 @@ if circuits is None: required_assocs = { 'provider': (Provider, 'name'), - 'circuit_type': (CircuitType, 'name') + 'type': (CircuitType, 'name') } for params in circuits: @@ -24,6 +24,6 @@ for params in circuits: circuit, created = Circuit.objects.get_or_create(**params) if created: - set_custom_fields_values(cid, custom_field_data) + set_custom_fields_values(circuit, custom_field_data) print("⚡ Created Circuit", circuit.cid)