Handle group cleanup a little differently

This commit is contained in:
James Page
2013-03-07 09:37:28 +00:00
parent 0dfcd7bd03
commit 04de024e38

View File

@@ -298,7 +298,10 @@ def configure_cluster():
# Checks that the resources are running and started.
# Ensure that clones are excluded as the resource is
# not directly controllable (dealt with below)
# Ensure that groups are cleaned up as a whole rather
# than as individual resources.
if (res_name not in clones.values() and
res_name not in groups.values() and
not pcmk.crm_res_running(res_name)):
# Just in case, cleanup the resources to ensure they get
# started in case they failed for some unrelated reason.
@@ -310,6 +313,11 @@ def configure_cluster():
cmd = 'crm resource cleanup %s' % cl_name
pcmk.commit(cmd)
for grp_name in groups:
# Always cleanup groups
cmd = 'crm resource cleanup %s' % grp_name
pcmk.commit(cmd)
for rel_id in utils.relation_ids('ha'):
utils.relation_set(rid=rel_id,
clustered="yes")