docker_swarm: add diff support (#52947)

* Add diff support to docker_swarm.

* Add changelog.

* Using diff mode for docker_swarm tests. This improves debugging, since the the module now outputs more information on *why* it did certain actions.
This commit is contained in:
Felix Fontein 2019-02-26 12:57:02 +01:00 committed by John R Barker
parent 84cc5202db
commit bf3c291606
3 changed files with 33 additions and 0 deletions

View file

@ -391,6 +391,11 @@ class SwarmManager(DockerBaseClass):
choice_map.get(self.state)()
if self.client.module._diff or self.parameters.debug:
diff = dict()
diff['before'], diff['after'] = self.differences.get_before_after()
self.results['diff'] = diff
def __isSwarmManager(self):
try:
data = self.client.inspect_swarm()