mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-04-16 20:48:25 +02:00
Fixed VM interface creation for Netbox 2.9
This commit is contained in:
parent
23c3240863
commit
9fae2b0f74
@ -1,5 +1,4 @@
|
|||||||
from dcim.models import Interface
|
from virtualization.models import VirtualMachine, VMInterface
|
||||||
from virtualization.models import VirtualMachine
|
|
||||||
from extras.models import CustomField, CustomFieldValue
|
from extras.models import CustomField, CustomFieldValue
|
||||||
from startup_script_utils import load_yaml
|
from startup_script_utils import load_yaml
|
||||||
import sys
|
import sys
|
||||||
@ -22,7 +21,7 @@ for params in interfaces:
|
|||||||
|
|
||||||
params[assoc] = model.objects.get(**query)
|
params[assoc] = model.objects.get(**query)
|
||||||
|
|
||||||
interface, created = Interface.objects.get_or_create(**params)
|
interface, created = VMInterface.objects.get_or_create(**params)
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
if custom_fields is not None:
|
if custom_fields is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user