Fix a crash when missing rack id #172
1 changed files with 1 additions and 3 deletions
|
@ -66,7 +66,6 @@ class ServerBase():
|
||||||
|
|
||||||
def update_netbox_location(self, server):
|
def update_netbox_location(self, server):
|
||||||
dc = self.get_datacenter()
|
dc = self.get_datacenter()
|
||||||
rack = self.get_rack()
|
|
||||||
nb_rack = self.get_netbox_rack()
|
nb_rack = self.get_netbox_rack()
|
||||||
nb_dc = self.get_netbox_datacenter()
|
nb_dc = self.get_netbox_datacenter()
|
||||||
|
|
||||||
|
@ -80,8 +79,7 @@ class ServerBase():
|
||||||
server.site = nb_dc.id
|
server.site = nb_dc.id
|
||||||
|
|
||||||
if (
|
if (
|
||||||
rack
|
server.rack
|
||||||
and server.rack
|
|
||||||
and nb_rack
|
and nb_rack
|
||||||
and server.rack.id != nb_rack.id
|
and server.rack.id != nb_rack.id
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in a new issue