Added newline and breaks.

This commit is contained in:
Alvaro Arriola 2019-10-11 15:46:32 +02:00
parent 821d6c8672
commit 4e1ac2392d
5 changed files with 5 additions and 1 deletions

View File

@ -9,4 +9,4 @@
# mac_address: 00:55:55:55:55:55 # mac_address: 00:55:55:55:55:55
# mtu: 1500 # mtu: 1500
# name: Network Interface 2 # name: Network Interface 2
# virtual_machine: virtual_machine1 # virtual_machine: virtual_machine1

View File

@ -39,6 +39,7 @@ with file.open('r') as stream:
for vlan_status in VLAN_STATUS_CHOICES: for vlan_status in VLAN_STATUS_CHOICES:
if params['status'] in vlan_status: if params['status'] in vlan_status:
params['status'] = vlan_status[0] params['status'] = vlan_status[0]
break
vlan, created = VLAN.objects.get_or_create(**params) vlan, created = VLAN.objects.get_or_create(**params)

View File

@ -42,6 +42,7 @@ with file.open('r') as stream:
for prefix_status in PREFIX_STATUS_CHOICES: for prefix_status in PREFIX_STATUS_CHOICES:
if params['status'] in prefix_status: if params['status'] in prefix_status:
params['status'] = prefix_status[0] params['status'] = prefix_status[0]
break
prefix, created = Prefix.objects.get_or_create(**params) prefix, created = Prefix.objects.get_or_create(**params)

View File

@ -47,6 +47,7 @@ with file.open('r') as stream:
for vm_status in VM_STATUS_CHOICES: for vm_status in VM_STATUS_CHOICES:
if params['status'] in vm_status: if params['status'] in vm_status:
params['status'] = vm_status[0] params['status'] = vm_status[0]
break
virtual_machine, created = VirtualMachine.objects.get_or_create(**params) virtual_machine, created = VirtualMachine.objects.get_or_create(**params)

View File

@ -53,6 +53,7 @@ with file.open('r') as stream:
for ip_status in IPADDRESS_STATUS_CHOICES: for ip_status in IPADDRESS_STATUS_CHOICES:
if params['status'] in ip_status: if params['status'] in ip_status:
params['status'] = ip_status[0] params['status'] = ip_status[0]
break
ip_address, created = IPAddress.objects.get_or_create(**params) ip_address, created = IPAddress.objects.get_or_create(**params)