From 7b9687f75885f168de52f935dc36f1d35b8b7ed7 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 19 Jul 2021 03:36:59 +0200 Subject: [PATCH] Fix snap's channel option. (#3028) --- changelogs/fragments/3028-snap-channel.yml | 2 ++ plugins/modules/packaging/os/snap.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3028-snap-channel.yml diff --git a/changelogs/fragments/3028-snap-channel.yml b/changelogs/fragments/3028-snap-channel.yml new file mode 100644 index 0000000000..c3aea4b5a0 --- /dev/null +++ b/changelogs/fragments/3028-snap-channel.yml @@ -0,0 +1,2 @@ +bugfixes: +- "snap - fix formatting of ``--channel`` argument when the ``channel`` option is used (https://github.com/ansible-collections/community.general/pull/3028)." diff --git a/plugins/modules/packaging/os/snap.py b/plugins/modules/packaging/os/snap.py index 6da8b0e766..de6fedccdc 100644 --- a/plugins/modules/packaging/os/snap.py +++ b/plugins/modules/packaging/os/snap.py @@ -145,7 +145,7 @@ class Snap(CmdStateModuleHelper): actionable_snaps=dict(fmt=lambda v: v), state=dict(fmt=_state_map), classic=dict(fmt="--classic", style=ArgFormat.BOOLEAN), - channel=dict(fmt=lambda v: [] if v == 'stable' else ['--channel', '{0}']), + channel=dict(fmt=lambda v: [] if v == 'stable' else ['--channel', '{0}'.format(v)]), ) check_rc = False