Skip to content

Commit

Permalink
Commit changes made by code formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 21, 2024
1 parent b53749e commit b009012
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/juniper_ap_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ def build_rename_ap_payload(

return payload


def find_value_in_list_of_dicts(list_of_dicts, key, value):
for dictionary in list_of_dicts:
if dictionary.get(key) == value:
return dictionary
raise ValueError(f"Value '{value}' not found for key '{key}' in the list of dictionaries.")
raise ValueError(
f"Value '{value}' not found for key '{key}' in the list of dictionaries.")


def find_inventory_item_by_mac_address(
Expand All @@ -171,11 +173,12 @@ def find_csv_item_by_mac_address(
mac: str
) -> list[dict]:

try:
result = find_value_in_list_of_dicts(ap_csv, "MAC Address", mac.upper())
return result
except ValueError as e:
print(e)
try:
result = find_value_in_list_of_dicts(
ap_csv, "MAC Address", mac.upper())
return result
except ValueError as e:
print(e)


def juniper_ap_assign(
Expand Down

0 comments on commit b009012

Please sign in to comment.