mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-17 04:32:54 -06:00
Corrected pylint errors
This commit is contained in:
parent
5defc1a25e
commit
537710a4b9
@ -60,16 +60,16 @@ def build_path(endpoint, list_of_dicts):
|
|||||||
This can be used to generate a joinable list to
|
This can be used to generate a joinable list to
|
||||||
be used in hostgroups.
|
be used in hostgroups.
|
||||||
"""
|
"""
|
||||||
path = []
|
item_path = []
|
||||||
itemlist = [i for i in list_of_dicts if i['name'] == endpoint]
|
itemlist = [i for i in list_of_dicts if i['name'] == endpoint]
|
||||||
item = itemlist[0] if len(itemlist) == 1 else None
|
item = itemlist[0] if len(itemlist) == 1 else None
|
||||||
path.append(item['name'])
|
item_path.append(item['name'])
|
||||||
while item['_depth'] > 0:
|
while item['_depth'] > 0:
|
||||||
itemlist = [i for i in list_of_dicts if i['name'] == str(item['parent'])]
|
itemlist = [i for i in list_of_dicts if i['name'] == str(item['parent'])]
|
||||||
item = itemlist[0] if len(itemlist) == 1 else None
|
item = itemlist[0] if len(itemlist) == 1 else None
|
||||||
path.append(item['name'])
|
item_path.append(item['name'])
|
||||||
path.reverse()
|
item_path.reverse()
|
||||||
return(path)
|
return item_path
|
||||||
|
|
||||||
def main(arguments):
|
def main(arguments):
|
||||||
"""Run the sync process."""
|
"""Run the sync process."""
|
||||||
|
Loading…
Reference in New Issue
Block a user