Merge pull request #246 from ypid/fix/various
fix: TypeError: Object of type Record is not JSON serializable; fix: disk is also virtual if `product` is None
This commit is contained in:
commit
53769db3e4
2 changed files with 2 additions and 3 deletions
|
@ -62,7 +62,7 @@ class ServerBase():
|
||||||
def get_netbox_datacenter(self):
|
def get_netbox_datacenter(self):
|
||||||
dc = self.get_datacenter()
|
dc = self.get_datacenter()
|
||||||
if dc is None:
|
if dc is None:
|
||||||
logging.error("Specificing a datacenter (Site) is mandatory in Netbox")
|
logging.error("Specifying a datacenter (Site) is mandatory in Netbox")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
nb_dc = nb.dcim.sites.get(
|
nb_dc = nb.dcim.sites.get(
|
||||||
|
|
|
@ -96,8 +96,7 @@ class VirtualMachine(object):
|
||||||
vm = nb.virtualization.virtual_machines.create(
|
vm = nb.virtualization.virtual_machines.create(
|
||||||
name=hostname,
|
name=hostname,
|
||||||
cluster=cluster.id,
|
cluster=cluster.id,
|
||||||
platform=self.device_platform,
|
platform=self.device_platform.id,
|
||||||
device_platform=self.device_platform,
|
|
||||||
vcpus=vcpus,
|
vcpus=vcpus,
|
||||||
memory=memory,
|
memory=memory,
|
||||||
tenant=tenant.id if tenant else None,
|
tenant=tenant.id if tenant else None,
|
||||||
|
|
Loading…
Reference in a new issue