diff --git a/initializers/dcim_interfaces.yml b/initializers/dcim_interfaces.yml index 8e6281e..9a73a47 100644 --- a/initializers/dcim_interfaces.yml +++ b/initializers/dcim_interfaces.yml @@ -1,8 +1,8 @@ #- device: server01 # enabled: true -# form_factor: Virtual +# type: Virtual # name: to-server02 #- device: server02 # enabled: true -# form_factor: Virtual +# type: Virtual # name: to-server01 diff --git a/initializers/ip_addresses.yml b/initializers/ip_addresses.yml index abcc918..29a3917 100644 --- a/initializers/ip_addresses.yml +++ b/initializers/ip_addresses.yml @@ -1,11 +1,11 @@ #- address: 10.1.1.1/24 # device: server01 -# interface: Loopback0 +# interface: to-server02 # status: Active # vrf: vrf1 #- address: 10.1.1.2/24 # device: server02 -# interface: Vlan5 +# interface: to-server01 # status: Active #- address: 10.1.1.10/24 # description: reserved IP diff --git a/initializers/platforms.yml b/initializers/platforms.yml index bc9926a..732dbeb 100644 --- a/initializers/platforms.yml +++ b/initializers/platforms.yml @@ -1,19 +1,15 @@ -# # Allowed rpc clients are: juniper-junos, cisco-ios, opengear # - name: Platform 1 # slug: platform-1 # manufacturer: Manufacturer 1 # napalm_driver: driver1 # napalm_args: "{'arg1': 'value1', 'arg2': 'value2'}" -# rpc_client: juniper-junos # - name: Platform 2 # slug: platform-2 # manufacturer: Manufacturer 2 # napalm_driver: driver2 # napalm_args: "{'arg1': 'value1', 'arg2': 'value2'}" -# rpc_client: opengear # - name: Platform 3 # slug: platform-3 # manufacturer: NoName # napalm_driver: driver3 # napalm_args: "{'arg1': 'value1', 'arg2': 'value2'}" -# rpc_client: juniper-junos diff --git a/initializers/prefixes.yml b/initializers/prefixes.yml index ef6330a..f70685c 100644 --- a/initializers/prefixes.yml +++ b/initializers/prefixes.yml @@ -12,7 +12,6 @@ # vlan: vlan2 # is_pool: true # vrf: vrf2 -# tenant: tenant2 #- description: ipv6 prefix1 # prefix: fd00:ccdd:a000:1::/64 # site: AMS 2 diff --git a/initializers/tenants_groups.yml b/initializers/tenant_groups.yml similarity index 100% rename from initializers/tenants_groups.yml rename to initializers/tenant_groups.yml diff --git a/initializers/virtualization_interfaces.yml b/initializers/virtualization_interfaces.yml index 15a64ab..37d3252 100644 --- a/initializers/virtualization_interfaces.yml +++ b/initializers/virtualization_interfaces.yml @@ -3,10 +3,10 @@ # mac_address: 00:77:77:77:77:77 # mtu: 1500 # name: Network Interface 1 -# virtual_machine: virtual_machine1 +# virtual_machine: virtual machine 1 #- description: Network Interface 2 # enabled: true # mac_address: 00:55:55:55:55:55 # mtu: 1500 # name: Network Interface 2 -# virtual_machine: virtual_machine1 \ No newline at end of file +# virtual_machine: virtual machine 1 diff --git a/initializers/vlan_groups.yml b/initializers/vlan_groups.yml index 11a48fc..81546eb 100644 --- a/initializers/vlan_groups.yml +++ b/initializers/vlan_groups.yml @@ -1,6 +1,6 @@ #- name: VLAN group 1 # site: AMS 1 -# slug: vlan-group-2 +# slug: vlan-group-1 #- name: VLAN group 2 # site: AMS 1 # slug: vlan-group-2 diff --git a/initializers/vrfs.yml b/initializers/vrfs.yml index 0f3684d..fd50d87 100644 --- a/initializers/vrfs.yml +++ b/initializers/vrfs.yml @@ -6,4 +6,3 @@ # name: vrf2 # rd: "6500:6500" # tenant: tenant2 -# tenant_group: Tenant Group 2 diff --git a/startup_scripts/010_groups.py b/startup_scripts/010_groups.py index de8705c..e68a5f0 100644 --- a/startup_scripts/010_groups.py +++ b/startup_scripts/010_groups.py @@ -27,7 +27,6 @@ with file.open('r') as stream: group_permissions = group_details.get('permissions', []) if group_permissions: group.permissions.clear() - print("Permissions:", group.permissions.all()) for permission_codename in group_details.get('permissions', []): for permission in Permission.objects.filter(codename=permission_codename): group.permissions.add(permission) diff --git a/startup_scripts/210_vlans.py b/startup_scripts/210_vlans.py index c667354..e3a0ef1 100644 --- a/startup_scripts/210_vlans.py +++ b/startup_scripts/210_vlans.py @@ -39,6 +39,7 @@ with file.open('r') as stream: for vlan_status in VLAN_STATUS_CHOICES: if params['status'] in vlan_status: params['status'] = vlan_status[0] + break vlan, created = VLAN.objects.get_or_create(**params) diff --git a/startup_scripts/220_prefixes.py b/startup_scripts/220_prefixes.py index 69d78f2..a832c88 100644 --- a/startup_scripts/220_prefixes.py +++ b/startup_scripts/220_prefixes.py @@ -42,6 +42,7 @@ with file.open('r') as stream: for prefix_status in PREFIX_STATUS_CHOICES: if params['status'] in prefix_status: params['status'] = prefix_status[0] + break prefix, created = Prefix.objects.get_or_create(**params) diff --git a/startup_scripts/230_virtual_machines.py b/startup_scripts/230_virtual_machines.py index af30ee2..065b600 100644 --- a/startup_scripts/230_virtual_machines.py +++ b/startup_scripts/230_virtual_machines.py @@ -47,6 +47,7 @@ with file.open('r') as stream: for vm_status in VM_STATUS_CHOICES: if params['status'] in vm_status: params['status'] = vm_status[0] + break virtual_machine, created = VirtualMachine.objects.get_or_create(**params) diff --git a/startup_scripts/250_dcim_interfaces.py b/startup_scripts/250_dcim_interfaces.py index b0baf39..ce7e7bd 100644 --- a/startup_scripts/250_dcim_interfaces.py +++ b/startup_scripts/250_dcim_interfaces.py @@ -28,11 +28,11 @@ with file.open('r') as stream: params[assoc] = model.objects.get(**query) - if 'form_factor' in params: + if 'type' in params: for outer_list in IFACE_TYPE_CHOICES: - for ffactor_choices in outer_list[1]: - if params['form_factor'] in ffactor_choices: - params['form_factor'] = ffactor_choices[0] + for type_choices in outer_list[1]: + if params['type'] in type_choices: + params['type'] = type_choices[0] break else: continue diff --git a/startup_scripts/260_ip_addresses.py b/startup_scripts/260_ip_addresses.py index 589c5d3..f7f2bc7 100644 --- a/startup_scripts/260_ip_addresses.py +++ b/startup_scripts/260_ip_addresses.py @@ -53,6 +53,7 @@ with file.open('r') as stream: for ip_status in IPADDRESS_STATUS_CHOICES: if params['status'] in ip_status: params['status'] = ip_status[0] + break ip_address, created = IPAddress.objects.get_or_create(**params)