File pacemaker-crm_resource-cleanup-for-saved-configuration.patch of Package pacemaker.14737
commit 870ebe5152d586198366a791d67f4e218df0b743
Author: Andrew Beekhof <andrew@beekhof.net>
Date: Wed Oct 11 13:27:32 2017 +1100
Test: crm_resource: See what cleanup would have done for a saved configuration
Index: pacemaker/tools/crm_resource.c
===================================================================
--- pacemaker.orig/tools/crm_resource.c
+++ pacemaker/tools/crm_resource.c
@@ -761,7 +761,7 @@ main(int argc, char **argv)
}
/* Establish a connection to the CRMd if needed */
- if (require_crmd) {
+ if (getenv("CIB_file") == NULL && require_crmd) {
xmlNode *xml = NULL;
mainloop_io_t *source =
mainloop_add_ipc_client(CRM_SYSTEM_CRMD, G_PRIORITY_DEFAULT, 0, NULL, &crm_callbacks);
Index: pacemaker/tools/crm_resource_runtime.c
===================================================================
--- pacemaker.orig/tools/crm_resource_runtime.c
+++ pacemaker/tools/crm_resource_runtime.c
@@ -639,6 +639,11 @@ cli_resource_delete(cib_t *cib_conn, crm
return pcmk_ok;
}
+ if(getenv("CIB_file") != NULL) {
+ printf("Would have cleaned up %s on %s\n", rsc->id, host_uname);
+ return rc;
+ }
+
node = pe_find_node(data_set->nodes, host_uname);
if (node && node->details->rsc_discovery_enabled) {