From a9232e4f305fd4273a37cff615a5e4e47a9ad006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= Date: Fri, 22 May 2020 17:37:14 +0200 Subject: [PATCH] Add optional primary_ip on virtual machines initializer --- startup_scripts/230_virtual_machines.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/startup_scripts/230_virtual_machines.py b/startup_scripts/230_virtual_machines.py index 6776c4d..4236fa4 100644 --- a/startup_scripts/230_virtual_machines.py +++ b/startup_scripts/230_virtual_machines.py @@ -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: