Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doozer/doozerlib/cli/images_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ def images_streams_gen_buildconfigs(runtime, streams, output, as_user, apply, li
major = runtime.group_config.vars['MAJOR']
minor = runtime.group_config.vars['MINOR']

rpm_repos_conf = runtime.group_config.repos or {}
# Use runtime.repos which handles both old-style and new-style repo configs
# Convert to Model objects to maintain compatibility with existing dot notation code
rpm_repos_conf = {name: Model(repo.to_dict()) for name, repo in runtime.repos.items()}

group_label = runtime.group_config.name
if live_test_mode:
Expand Down
15 changes: 2 additions & 13 deletions doozer/doozerlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,19 +630,8 @@ def calculate_config_digest(self, group_config, streams):

repos = set(image_config.get("enabled_repos", []) + image_config.get("non_shipping_repos", []))
if repos:
# Support both old-style (repos dict) and new-style (all_repos list) configurations
if "repos" in group_config:
# Old-style: repos are stored as a dict in group_config["repos"]
message["repos"] = {repo: group_config["repos"][repo] for repo in repos}
elif "all_repos" in group_config:
# New-style: repos are stored as a list in group_config["all_repos"]
# Build a dict from the list by matching repo names
all_repos_list = group_config["all_repos"]
message["repos"] = {
repo_config["name"]: repo_config
for repo_config in all_repos_list
if repo_config.get("name") in repos
}
# Use runtime.repos which handles both old-style and new-style configurations
message["repos"] = {repo: self.runtime.repos[repo].to_dict() for repo in repos}

builders = image_config.get("from", {}).get("builder", [])
from_stream = image_config.get("from", {}).get("stream")
Expand Down
4 changes: 4 additions & 0 deletions doozer/doozerlib/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ def __repr__(self):
"""For debugging mainly, to display contents as a dict"""
return str(self._data)

def to_dict(self) -> Dict:
"""Export repo configuration as a dictionary."""
return self._data.primitive()

def baseurl(self, repotype, arch):
if not repotype:
repotype = 'unsigned'
Expand Down