mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 12:12:57 -06:00
Update netbox_zabbix_sync.py
Minor bug fix for empty Netbox to zabbix inventory field mappings.
This commit is contained in:
parent
634f4b77d5
commit
3e638c6f78
@ -408,7 +408,7 @@ class NetworkDevice():
|
|||||||
value = nbdevice
|
value = nbdevice
|
||||||
# ... and step through the dict till we find the needed value
|
# ... and step through the dict till we find the needed value
|
||||||
for item in field_list:
|
for item in field_list:
|
||||||
value = value[item]
|
value = value[item] if value else None
|
||||||
# Check if the result is usable and expected
|
# Check if the result is usable and expected
|
||||||
if value and isinstance(value, int | float | str ):
|
if value and isinstance(value, int | float | str ):
|
||||||
self.inventory[zbx_inv_field] = str(value)
|
self.inventory[zbx_inv_field] = str(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user