From edf0d3ec999ebd3c9f5e4310b246c97c7ff21d52 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 28 Nov 2022 22:10:07 +0100 Subject: [PATCH] Make kill_signal accept strings. (#506) --- changelogs/fragments/506-docker_container-kill_signal.yml | 2 ++ plugins/module_utils/module_container/docker_api.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/506-docker_container-kill_signal.yml diff --git a/changelogs/fragments/506-docker_container-kill_signal.yml b/changelogs/fragments/506-docker_container-kill_signal.yml new file mode 100644 index 000000000..22c30f8d9 --- /dev/null +++ b/changelogs/fragments/506-docker_container-kill_signal.yml @@ -0,0 +1,2 @@ +bugfixes: + - "docker_container - the ``kill_signal`` option erroneously did not accept strings anymore since 3.0.0 (https://github.com/ansible-collections/community.docker/issues/505, https://github.com/ansible-collections/community.docker/pull/506)." diff --git a/plugins/module_utils/module_container/docker_api.py b/plugins/module_utils/module_container/docker_api.py index a115292d6..490aecd1f 100644 --- a/plugins/module_utils/module_container/docker_api.py +++ b/plugins/module_utils/module_container/docker_api.py @@ -302,7 +302,7 @@ def restart_container(self, client, container_id, timeout=None): def kill_container(self, client, container_id, kill_signal=None): params = {} if kill_signal is not None: - params['signal'] = int(kill_signal) + params['signal'] = kill_signal client.post_call('/containers/{0}/kill', container_id, params=params) def stop_container(self, client, container_id, timeout=None):