Skip to content

Commit

Permalink
Optimized code and also fixed Linter error.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNetworkGuy committed Jun 5, 2024
1 parent 8e95941 commit e0b473a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions netbox_zabbix_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ def main(arguments):
device.cleanup()
logger.info(f"Cleaned up host {device.name}.")
continue
else:
# Device has been added to Netbox
# but is not in Activate state
logger.info(f"Skipping host {device.name} since its "
f"not in the active state.")
continue
elif device.status in zabbix_device_disable:
# Device has been added to Netbox
# but is not in Activate state
logger.info(f"Skipping host {device.name} since its "
f"not in the active state.")
continue
if device.status in zabbix_device_disable:
device.zabbix_state = 1
else:
device.zabbix_state = 0
Expand Down

0 comments on commit e0b473a

Please sign in to comment.