dnf: ensure releasever is passed into libdnf as str (#77024)

Fixes #77010
pull/77031/head
Martin Krizek 3 years ago committed by GitHub
parent af7c9deb4e
commit 18251f3685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- dnf - ensure releasever is passed into libdnf as string (https://github.com/ansible/ansible/issues/77010)

@ -656,6 +656,14 @@ class DnfModule(YumDnf):
if self.releasever is not None:
conf.substitutions['releasever'] = self.releasever
if conf.substitutions.get('releasever') is None:
self.module.warn(
'Unable to detect release version (use "releasever" option to specify release version)'
)
# values of conf.substitutions are expected to be strings
# setting this to an empty string instead of None appears to mimic the DNF CLI behavior
conf.substitutions['releasever'] = ''
# Set skip_broken (in dnf this is strict=0)
if self.skip_broken:
conf.strict = 0

Loading…
Cancel
Save