mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 04:02:56 -06:00
corrected even more linting errors
This commit is contained in:
parent
ab2a341fa7
commit
364d376f55
@ -406,7 +406,7 @@ class NetworkDevice():
|
|||||||
fieldstr += "['" + field + "']"
|
fieldstr += "['" + field + "']"
|
||||||
try:
|
try:
|
||||||
nb_value = eval(fieldstr)
|
nb_value = eval(fieldstr)
|
||||||
except:
|
except Exception:
|
||||||
nb_value = None
|
nb_value = None
|
||||||
if nb_value and isinstance(nb_value, int | float | str ):
|
if nb_value and isinstance(nb_value, int | float | str ):
|
||||||
self.inventory[zbx_inv_field] = str(nb_value)
|
self.inventory[zbx_inv_field] = str(nb_value)
|
||||||
@ -415,7 +415,7 @@ class NetworkDevice():
|
|||||||
self.inventory[zbx_inv_field] = ""
|
self.inventory[zbx_inv_field] = ""
|
||||||
else:
|
else:
|
||||||
# Value is not a string or numeral, probably not what the user expected.
|
# Value is not a string or numeral, probably not what the user expected.
|
||||||
logger.error(f"Inventory lookup for '{nb_inv_field}' returned"
|
logger.error(f"Inventory lookup for '{nb_inv_field}' returned"
|
||||||
f" an unexpected type: it will be skipped.")
|
f" an unexpected type: it will be skipped.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user