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)