From 154e1902de90eeda5736e7ece604dd17c8fd3381 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:15:40 +0200 Subject: [PATCH] Fix error formatting bug. (#448) (#450) (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 c9fc543c..6558734b 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)