commit 8da149c887c80b1bcf778089268b060e014159ef Author: Andrew Beekhof Date: Thu Oct 3 17:01:38 2013 +1000 Fix: crm_resource: Wait for all replies when cleaning up resources (cherry picked from commit 62e59ab2ad211cef798792632ad7df4f8a5c3418) diff --git a/tools/crm_resource.c b/tools/crm_resource.c index 44d96b0..c03501d 100644 --- a/tools/crm_resource.c +++ b/tools/crm_resource.c @@ -801,11 +801,15 @@ delete_lrm_rsc(cib_t *cib_conn, crm_ipc_t * crmd_channel, const char *host_uname printf("Cleaning up %s on %s\n", rsc->id, host_uname); rc = send_lrm_rsc_op(crmd_channel, CRM_OP_LRM_DELETE, host_uname, rsc->id, TRUE, data_set); + if (rc == pcmk_ok) { char *attr_name = NULL; const char *id = rsc->id; node_t *node = pe_find_node(data_set->nodes, host_uname); + if(node->details->remote_rsc == NULL) { + crmd_replies_needed++; + } if (rsc->clone_name) { id = rsc->clone_name; } @@ -2165,6 +2169,7 @@ main(int argc, char **argv) crm_debug("Re-checking the state of %s on %s", rsc_id, host_uname); if(rsc) { + crmd_replies_needed = 0; rc = delete_lrm_rsc(cib_conn, crmd_channel, host_uname, rsc, &data_set); } else { rc = -ENODEV;