docker_swarm: hopefully fix debug CI problems, and fix check mode (#52825)

* Let's see some debug output.

* Also check LocalNodeState.

* Improve tests.

* Actually implement check mode.

* Add changelog.

* Add pretty-printing and more output.
This commit is contained in:
Felix Fontein 2019-02-23 23:18:17 +01:00 committed by ansibot
parent e2856127f6
commit 81d58cfef6
5 changed files with 93 additions and 33 deletions

View file

@ -62,6 +62,8 @@ class AnsibleDockerSwarmClient(AnsibleDockerClient):
swarm_info = json.loads(json_str)
if swarm_info['Swarm']['NodeID']:
return True
if swarm_info['Swarm']['LocalNodeState'] in ('active', 'pending', 'locked'):
return True
return False
else:
try: