Fully disable inventory if set as false in config

This commit is contained in:
Pierre Lannoy 2024-02-03 14:45:41 +01:00
commit e9b2701916
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31

View file

@ -413,10 +413,10 @@ class ServerBase():
self.network.create_or_update_netbox_network_cards()
update_inventory = config.inventory and (config.register or
config.update_all or config.update_inventory)
# update inventory if feature is enabled
self.inventory = Inventory(server=self)
if update_inventory:
self.inventory.create_or_update()
if config.inventory:
self.inventory = Inventory(server=self)
if update_inventory:
self.inventory.create_or_update()
# update psu
if config.register or config.update_all or config.update_psu:
self.power = PowerSupply(server=self)