From 09c56140cd01e5d69b4beb9ba2e13c911a2df818 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 27 Oct 2016 12:36:46 -0700 Subject: [PATCH] * Fix for spaces in the package spec. * Fix for python-2.6 compat --- lib/ansible/modules/extras/packaging/os/dnf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/dnf.py b/lib/ansible/modules/extras/packaging/os/dnf.py index fc953531ce..8631260ee4 100644 --- a/lib/ansible/modules/extras/packaging/os/dnf.py +++ b/lib/ansible/modules/extras/packaging/os/dnf.py @@ -286,13 +286,13 @@ def ensure(module, base, state, names): if state in ['installed', 'present']: # Install files. - for filename in filenames: + for filename in (f.strip() for f in filenames): base.package_install(base.add_remote_rpm(filename)) # Install groups. - for group in groups: + for group in (g.strip() for g in groups): base.group_install(group, dnf.const.GROUP_PACKAGE_TYPES) # Install packages. - for pkg_spec in pkg_specs: + for pkg_spec in (p.strip() for p in pkg_specs): _mark_package_install(module, base, pkg_spec) elif state == 'latest': @@ -337,9 +337,9 @@ def ensure(module, base, state, names): base.do_transaction() response = {'changed': True, 'results': []} for package in base.transaction.install_set: - response['results'].append("Installed: {}".format(package)) + response['results'].append("Installed: {0}".format(package)) for package in base.transaction.remove_set: - response['results'].append("Removed: {}".format(package)) + response['results'].append("Removed: {0}".format(package)) module.exit_json(**response)