Skip to content

Commit a9232e4

Browse files
committed
Add optional primary_ip on virtual machines initializer
1 parent 45f7823 commit a9232e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

startup_scripts/230_virtual_machines.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dcim.models import Site, Platform, DeviceRole
2+
from ipam.models import IPAddress
23
from virtualization.models import Cluster, VirtualMachine
34
from tenancy.models import Tenant
45
from extras.models import CustomField, CustomFieldValue
@@ -17,7 +18,9 @@
1718
optional_assocs = {
1819
'tenant': (Tenant, 'name'),
1920
'platform': (Platform, 'name'),
20-
'role': (DeviceRole, 'name')
21+
'role': (DeviceRole, 'name'),
22+
'primary_ip4': (IPAddress, 'address'),
23+
'primary_ip6': (IPAddress, 'address')
2124
}
2225

2326
for params in virtual_machines:

0 commit comments

Comments
 (0)