mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-14 01:41:25 -06:00
Optimized code and also fixed Linter error.
This commit is contained in:
parent
8e9594172b
commit
e0b473a6d4
@ -182,13 +182,12 @@ def main(arguments):
|
|||||||
device.cleanup()
|
device.cleanup()
|
||||||
logger.info(f"Cleaned up host {device.name}.")
|
logger.info(f"Cleaned up host {device.name}.")
|
||||||
continue
|
continue
|
||||||
else:
|
# Device has been added to Netbox
|
||||||
# Device has been added to Netbox
|
# but is not in Activate state
|
||||||
# but is not in Activate state
|
logger.info(f"Skipping host {device.name} since its "
|
||||||
logger.info(f"Skipping host {device.name} since its "
|
f"not in the active state.")
|
||||||
f"not in the active state.")
|
continue
|
||||||
continue
|
if device.status in zabbix_device_disable:
|
||||||
elif device.status in zabbix_device_disable:
|
|
||||||
device.zabbix_state = 1
|
device.zabbix_state = 1
|
||||||
else:
|
else:
|
||||||
device.zabbix_state = 0
|
device.zabbix_state = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user