Skip to content

Commit

Permalink
pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 10, 2023
1 parent a3e7e90 commit aa1056c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Code/autopkg
Expand Up @@ -2715,7 +2715,7 @@ def main(argv):
if verb == "version":
print_version()
return 0

# First, populate the recipe map
read_recipe_map()

Expand Down
11 changes: 9 additions & 2 deletions Code/autopkglib/__init__.py
Expand Up @@ -456,7 +456,9 @@ def find_recipe_by_identifier(
identifier: str, skip_overrides: bool = False
) -> Optional[str]:
"""Search recipe map for an identifier"""
if not skip_overrides and identifier in globalRecipeMap.get("overrides-identifiers", {}):
if not skip_overrides and identifier in globalRecipeMap.get(
"overrides-identifiers", {}
):
if valid_recipe_file(globalRecipeMap["overrides-identifiers"][identifier]):
log(f"Found {identifier} in recipe map overrides")
return globalRecipeMap["overrides-identifiers"][identifier]
Expand Down Expand Up @@ -616,7 +618,12 @@ def read_recipe_map(rebuild: bool = True) -> None:
with open(os.path.join(autopkg_user_folder(), "recipe_map.json"), "r") as f:
recipe_map = json.load(f)
# Let's do some validation first
expected_keys = ["identifiers", "overrides", "overrides-identifiers", "shortnames"]
expected_keys = [
"identifiers",
"overrides",
"overrides-identifiers",
"shortnames",
]
if not set(expected_keys).issubset(recipe_map.keys()):
raise OSError
globalRecipeMap.update(recipe_map)
Expand Down

0 comments on commit aa1056c

Please sign in to comment.