mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-13 15:24:48 -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
|
||||
be used in hostgroups.
|
||||
"""
|
||||
path = []
|
||||
item_path = []
|
||||
itemlist = [i for i in list_of_dicts if i['name'] == endpoint]
|
||||
item = itemlist[0] if len(itemlist) == 1 else None
|
||||
path.append(item['name'])
|
||||
item_path.append(item['name'])
|
||||
while item['_depth'] > 0:
|
||||
itemlist = [i for i in list_of_dicts if i['name'] == str(item['parent'])]
|
||||
item = itemlist[0] if len(itemlist) == 1 else None
|
||||
path.append(item['name'])
|
||||
path.reverse()
|
||||
return(path)
|
||||
item_path.append(item['name'])
|
||||
item_path.reverse()
|
||||
return item_path
|
||||
|
||||
def main(arguments):
|
||||
"""Run the sync process."""
|
||||
|
Loading…
Reference in New Issue
Block a user