diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2022-02-15 16:12:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 10:12:47 -0500 |
commit | 18251f368511d1eaa161380517c29f6d7839d229 (patch) | |
tree | fc429d42f394f8c0125506290250d2b2fbf25e4b /lib/ansible/modules/dnf.py | |
parent | af7c9deb4ed4c6b9a526a40f976bb52c570fced1 (diff) | |
download | ansible-18251f368511d1eaa161380517c29f6d7839d229.tar.gz |
dnf: ensure releasever is passed into libdnf as str (#77024)
Fixes #77010
Diffstat (limited to 'lib/ansible/modules/dnf.py')
-rw-r--r-- | lib/ansible/modules/dnf.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ansible/modules/dnf.py b/lib/ansible/modules/dnf.py index 5e264d6781..44f9a714dc 100644 --- a/lib/ansible/modules/dnf.py +++ b/lib/ansible/modules/dnf.py @@ -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 |