Open joaolucasmacedo opened 2 years ago
I have fixed this by adding the following two lines to the end of class and def run:
class NewVM(Script):
class Meta:
name = "New VM"
description = "Create a new VM"
vm_name = StringVar(label="VM name")
....
site = ObjectVar(model=Site, required=True)`
def run(self, data, commit):
vm = VirtualMachine(
name=data["vm_name"],
....
site=data.get("site"),
)
Looks like when a selected cluster have a site the script returns an error.
I'm running Netbox 3.3.2 with Python 3.10.
Maybe it is something related to the newer Netbox version.