Add optional primary_ip on virtual machines initializer

This commit is contained in:
Aurélien Dunand 2020-05-22 17:37:14 +02:00
parent 45f7823a17
commit a9232e4f30

View File

@ -1,4 +1,5 @@
from dcim.models import Site, Platform, DeviceRole from dcim.models import Site, Platform, DeviceRole
from ipam.models import IPAddress
from virtualization.models import Cluster, VirtualMachine from virtualization.models import Cluster, VirtualMachine
from tenancy.models import Tenant from tenancy.models import Tenant
from extras.models import CustomField, CustomFieldValue from extras.models import CustomField, CustomFieldValue
@ -17,7 +18,9 @@ required_assocs = {
optional_assocs = { optional_assocs = {
'tenant': (Tenant, 'name'), 'tenant': (Tenant, 'name'),
'platform': (Platform, 'name'), 'platform': (Platform, 'name'),
'role': (DeviceRole, 'name') 'role': (DeviceRole, 'name'),
'primary_ip4': (IPAddress, 'address'),
'primary_ip6': (IPAddress, 'address')
} }
for params in virtual_machines: for params in virtual_machines: