Skip to content

Commit

Permalink
Fix reading overlay files to populate repos
Browse files Browse the repository at this point in the history
  • Loading branch information
revati-naik-apex committed Feb 14, 2025
1 parent c7782fc commit 19aebf9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions repos/config/detail/lock_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ def main():
with open(args.repos, "r") as repos_file:
repos = yaml.safe_load(repos_file)

for overlay in args.overlays:
with open(overlay, "r") as overlay_file:
try:
overlay_content = yaml.safe_load(overlay_file)
except yaml.YAMLError as exc:
print(f"Error parsing YAML file {overlay}: {exc}")
continue
if "repositories" in overlay_content:
for repo, spec in overlay_content["repositories"].items():
repos["repositories"].setdefault(repo, {}).update(spec)
repos["repositories"].get(repo, {}).update(spec)
if repos.get("repositories") is None:
raise ValueError("No repositories attribute found")

Expand Down

0 comments on commit 19aebf9

Please sign in to comment.