From 0961d914d7a1d0e310775c1180dd82cd66f06829 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 18 Sep 2018 04:07:52 +0200 Subject: [PATCH] Don't parse/interpret options if state is 'absent'. (#45700) --- lib/ansible/modules/cloud/docker/docker_container.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker_container.py b/lib/ansible/modules/cloud/docker/docker_container.py index 470c1e2e17..34cc8d4c08 100644 --- a/lib/ansible/modules/cloud/docker/docker_container.py +++ b/lib/ansible/modules/cloud/docker/docker_container.py @@ -753,6 +753,11 @@ class TaskParameters(DockerBaseClass): for key, value in client.module.params.items(): setattr(self, key, value) + # If state is 'absent', parameters do not have to be parsed or interpreted. + # Only the container's name is needed. + if self.state == 'absent': + return + for param_name in REQUIRES_CONVERSION_TO_BYTES: if client.module.params.get(param_name): try: