mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-12-12 11:29:38 -06:00
corrected linting errors and a minor bug in cf_to_string
This commit is contained in:
parent
bc12064b6a
commit
c27505b927
@ -55,9 +55,8 @@ def cf_to_string(cf, key="name", logger=None):
|
|||||||
Converts a dict custom fields to string
|
Converts a dict custom fields to string
|
||||||
"""
|
"""
|
||||||
if isinstance(cf, dict):
|
if isinstance(cf, dict):
|
||||||
if key:
|
if key in cf:
|
||||||
return cf[key]
|
return cf[key]
|
||||||
else:
|
|
||||||
logger.error("Conversion of custom field failed, '%s' not found in cf dict.", key)
|
logger.error("Conversion of custom field failed, '%s' not found in cf dict.", key)
|
||||||
return None
|
return None
|
||||||
return cf
|
return cf
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user