From 433b5e187f4add0da78a829f266f32fdf6f9c78c Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Fri, 12 Aug 2016 12:14:34 -0400 Subject: [PATCH] If debug true, include actions and differences in output. --- lib/ansible/modules/cloud/docker/docker_container.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker_container.py b/lib/ansible/modules/cloud/docker/docker_container.py index 1315d539027..e44b1b00214 100644 --- a/lib/ansible/modules/cloud/docker/docker_container.py +++ b/lib/ansible/modules/cloud/docker/docker_container.py @@ -680,6 +680,7 @@ class TaskParameters(DockerBaseClass): self.cpuset_mems = None self.cpu_shares = None self.detach = None + self.debug = None self.devices = None self.dns_servers = None self.dns_opts = None @@ -1606,13 +1607,10 @@ class ContainerManager(DockerBaseClass): elif state == 'absent': self.absent() - if not self.check_mode: - try: - del self.results['actions'] - except: - pass + if not self.check_mode and not self.parameters.debug: + self.results.pop('actions') - if self.client.module._diff: + if self.client.module._diff or self.parameters.debug: self.results['diff'] = self.diff if self.facts: