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
1 changed files with 4 additions and 1 deletions

View File

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