From 055c8dac9c6d0cdbb332fb5df6e006b2c4564bbf Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 4 Apr 2021 23:59:59 +0200 Subject: [PATCH] fixed calls to list.extend() (#2161) (#2166) * fixed calls to list.extend() * added changelog fragment * Update changelogs/fragments/2161-pkgutil-list-extend.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit d92d0632eb374ca1472d32c1473507a596cfa58b) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/2161-pkgutil-list-extend.yml | 2 ++ plugins/modules/packaging/os/pkgutil.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/2161-pkgutil-list-extend.yml diff --git a/changelogs/fragments/2161-pkgutil-list-extend.yml b/changelogs/fragments/2161-pkgutil-list-extend.yml new file mode 100644 index 0000000000..9af970afd8 --- /dev/null +++ b/changelogs/fragments/2161-pkgutil-list-extend.yml @@ -0,0 +1,2 @@ +bugfixes: + - pkgutil - fixed calls to ``list.extend()`` (https://github.com/ansible-collections/community.general/pull/2161). diff --git a/plugins/modules/packaging/os/pkgutil.py b/plugins/modules/packaging/os/pkgutil.py index 9ec0ebaad6..0f1daca4ef 100644 --- a/plugins/modules/packaging/os/pkgutil.py +++ b/plugins/modules/packaging/os/pkgutil.py @@ -130,7 +130,7 @@ def packages_not_latest(module, names, site, update_catalog): cmd.append('-U') cmd.append('-c') if site is not None: - cmd.extend('-t', site) + cmd.extend(['-t', site]) if names != ['*']: cmd.extend(names) rc, out, err = run_command(module, cmd) @@ -159,7 +159,7 @@ def package_install(module, state, pkgs, site, update_catalog, force): if update_catalog: cmd.append('-U') if site is not None: - cmd.extend('-t', site) + cmd.extend(['-t', site]) if force: cmd.append('-f') cmd.extend(pkgs) @@ -174,7 +174,7 @@ def package_upgrade(module, pkgs, site, update_catalog, force): if update_catalog: cmd.append('-U') if site is not None: - cmd.extend('-t', site) + cmd.extend(['-t', site]) if force: cmd.append('-f') cmd += pkgs