From ee48f36269e1c5146059f0f43b7f1feb693949b1 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:15:36 +0200 Subject: [PATCH] Fix error formatting bug. (#448) (#449) (cherry picked from commit f513ba2c59bb2d0d65f9e352ee2bc986afd199d3) Co-authored-by: Felix Fontein --- changelogs/fragments/448-docker_stack-error.yml | 2 ++ plugins/modules/docker_stack.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/448-docker_stack-error.yml diff --git a/changelogs/fragments/448-docker_stack-error.yml b/changelogs/fragments/448-docker_stack-error.yml new file mode 100644 index 00000000..18d11d47 --- /dev/null +++ b/changelogs/fragments/448-docker_stack-error.yml @@ -0,0 +1,2 @@ +bugfixes: + - "docker_stack - fix broken string formatting when reporting error in case ``compose`` was containing invalid values (https://github.com/ansible-collections/community.docker/pull/448)." diff --git a/plugins/modules/docker_stack.py b/plugins/modules/docker_stack.py index e37abdf2..2854d61e 100644 --- a/plugins/modules/docker_stack.py +++ b/plugins/modules/docker_stack.py @@ -248,8 +248,7 @@ def main(): elif isinstance(compose_def, string_types): compose_files.append(compose_def) else: - module.fail_json(msg="compose element '%s' must be a " + - "string or a dictionary" % compose_def) + module.fail_json(msg="compose element '%s' must be a string or a dictionary" % compose_def) before_stack_services = docker_stack_inspect(module, name)