Fix module failure with pacemaker_cluster: state=cleanup (#27846)

* Fix module failure with pacemaker_cluster: state=cleanup

If state=cleanup was used, set_cluster() was being called
with 'cleanup' state which it doesn't handle. Instead
use existing clean_cluster() method.

Fixes #27799

* get and return cluster_state on state=clean as well
This commit is contained in:
Adrian Likins 2017-08-09 10:43:16 -04:00 committed by Brian Coca
parent 52a8ed55ee
commit 767cd82e42

View file

@ -219,7 +219,8 @@ def main():
module.fail_json(msg="Failed during the restart of the cluster, the cluster can't be stopped")
if state in ['cleanup']:
set_cluster(module, state, timeout, force)
clean_cluster(module, timeout)
cluster_state = get_cluster_status(module)
module.exit_json(changed=True,
out=cluster_state)