fix not passing tenant when tenants exist in Netbox
This commit is contained in:
parent
f936aeb717
commit
70146b8614
2 changed files with 10 additions and 4 deletions
|
|
@ -37,10 +37,13 @@ class ServerBase():
|
||||||
return tenant.get()
|
return tenant.get()
|
||||||
|
|
||||||
def get_netbox_tenant(self):
|
def get_netbox_tenant(self):
|
||||||
tenant = nb.tenancy.tenants.get(
|
tenant = self.get_tenant()
|
||||||
|
if tenant is None:
|
||||||
|
return None
|
||||||
|
nb_tenant = nb.tenancy.tenants.get(
|
||||||
slug=self.get_tenant()
|
slug=self.get_tenant()
|
||||||
)
|
)
|
||||||
return tenant
|
return nb_tenant
|
||||||
|
|
||||||
def get_datacenter(self):
|
def get_datacenter(self):
|
||||||
dc = Datacenter()
|
dc = Datacenter()
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,13 @@ class VirtualMachine(object):
|
||||||
return tenant.get()
|
return tenant.get()
|
||||||
|
|
||||||
def get_netbox_tenant(self):
|
def get_netbox_tenant(self):
|
||||||
tenant = nb.tenancy.tenants.get(
|
tenant = self.get_tenant()
|
||||||
|
if tenant is None:
|
||||||
|
return None
|
||||||
|
nb_tenant = nb.tenancy.tenants.get(
|
||||||
slug=self.get_tenant()
|
slug=self.get_tenant()
|
||||||
)
|
)
|
||||||
return tenant
|
return nb_tenant
|
||||||
|
|
||||||
def netbox_create_or_update(self, config):
|
def netbox_create_or_update(self, config):
|
||||||
logging.debug('It\'s a virtual machine')
|
logging.debug('It\'s a virtual machine')
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue