Corrected pylint errors

This commit is contained in:
Raymond Kuiper 2024-03-25 11:56:17 +01:00
parent 5defc1a25e
commit 537710a4b9

View File

@ -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."""