From ec8c1cb34aa00bc940ffb8efd4b7ba5a3feb5ab2 Mon Sep 17 00:00:00 2001 From: Philippe Makowski Date: Mon, 18 Feb 2019 18:09:23 +0100 Subject: [PATCH] fix bug #47154 (#49881) (cherry picked from commit 61743ab39a870bf65bc4646e3e5526b00b1276d6) backport bugfix for urpmi module add changelog --- .../fragments/49881-fix-broken-urpmi-module.yaml | 2 ++ lib/ansible/modules/packaging/os/urpmi.py | 10 ++-------- 2 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/49881-fix-broken-urpmi-module.yaml diff --git a/changelogs/fragments/49881-fix-broken-urpmi-module.yaml b/changelogs/fragments/49881-fix-broken-urpmi-module.yaml new file mode 100644 index 00000000000..08a57eb63a3 --- /dev/null +++ b/changelogs/fragments/49881-fix-broken-urpmi-module.yaml @@ -0,0 +1,2 @@ +bugfixes: + - urpmi module - fixed issue #47154 can't install package with urpmi diff --git a/lib/ansible/modules/packaging/os/urpmi.py b/lib/ansible/modules/packaging/os/urpmi.py index f2ef0c6c4e8..41130bac30b 100644 --- a/lib/ansible/modules/packaging/os/urpmi.py +++ b/lib/ansible/modules/packaging/os/urpmi.py @@ -208,20 +208,14 @@ def main(): p = module.params - force_yes = p['force'] - no_recommends_yes = p['no_recommends'] - root = p['root'] - if p['update_cache']: update_package_db(module) - packages = p['package'] - if p['state'] in ['installed', 'present']: - install_packages(module, packages, root, force_yes, no_recommends_yes) + install_packages(module, p['name'], p['root'], p['force'], p['no_recommends']) elif p['state'] in ['removed', 'absent']: - remove_packages(module, packages, root) + remove_packages(module, p['name'], p['root']) if __name__ == '__main__':