From 8563c2616b5dac28880c9955680985038d603b10 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 27 Feb 2019 10:07:01 +0100 Subject: [PATCH] docker_swarm: fix diff mode and details (#53053) * Fix diff messages for leaving swarm. * Remove superfluous brakets. --- lib/ansible/modules/cloud/docker/docker_swarm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker_swarm.py b/lib/ansible/modules/cloud/docker/docker_swarm.py index de9a5ea1ea2..6687aa86bb0 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm.py @@ -434,7 +434,7 @@ class SwarmManager(DockerBaseClass): self.client.fail("Swarm not created or other error!") self.inspect_swarm() self.results['actions'].append("New Swarm cluster created: %s" % (self.swarm_info.get('ID'))) - self.differences.add('state', parameter='absent', active='present') + self.differences.add('state', parameter='present', active='absent') self.results['changed'] = True self.results['swarm_facts'] = {u'JoinTokens': self.swarm_info.get('JoinTokens')} @@ -480,7 +480,7 @@ class SwarmManager(DockerBaseClass): self.results['changed'] = True def leave(self): - if not(self.client.check_if_swarm_node()): + if not self.client.check_if_swarm_node(): self.results['actions'].append("This node is not part of a swarm.") return if not self.check_mode: @@ -493,7 +493,7 @@ class SwarmManager(DockerBaseClass): self.results['changed'] = True def remove(self): - if not(self.client.check_if_swarm_manager()): + if not self.client.check_if_swarm_manager(): self.client.fail("This node is not a manager.") try: