Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnfbase: Fix substitutions #1380

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from 1 commit
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
12 changes: 4 additions & 8 deletions src/pylorax/dnfbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def sanitize_repo(repo):
log.info("Using %s for module_platform_id", platform_id)
conf.module_platform_id = platform_id

# Set variables used for substitutions
dnfbase.get_vars().set("releasever", releasever)
dnfbase.get_vars().set("basearch", basearch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good place for setting vars.


# Add .repo files
if repos:
reposdir = os.path.join(tempdir, "dnf.repos")
Expand Down Expand Up @@ -210,14 +214,6 @@ def sanitize_repo(repo):
return None
log.info("Using repos: %s", ", ".join(r.get_id() for r in rq))

# Add substitutions to all enabled repos
for r in rq:
# Substitutions used with the repo url
r.set_substitutions({
"releasever": releasever,
"basearch": basearch,
})

log.info("Fetching metadata...")
try:
sack.update_and_load_enabled_repos(False)
Expand Down
Loading