diff --git a/tools/crm_resource_runtime.c b/tools/crm_resource_runtime.c index 01919f6..0fbb669 100644 --- a/tools/crm_resource_runtime.c +++ b/tools/crm_resource_runtime.c @@ -877,7 +877,7 @@ cli_cleanup_all(crm_ipc_t *crmd_channel, const char *node_name, void cli_resource_check(cib_t * cib_conn, resource_t *rsc) { - int need_nl = 0; + bool printed = false; char *role_s = NULL; char *managed = NULL; resource_t *parent = uber_parent(rsc); @@ -896,23 +896,26 @@ cli_resource_check(cib_t * cib_conn, resource_t *rsc) // Treated as if unset } else if(role == RSC_ROLE_STOPPED) { - printf("\n * The configuration specifies that '%s' should remain stopped\n", parent->id); - need_nl++; + printf("\n * Configuration specifies '%s' should remain stopped\n", + parent->id); + printed = true; } else if (is_set(parent->flags, pe_rsc_promotable) && (role == RSC_ROLE_SLAVE)) { - printf("\n * The configuration specifies that '%s' should not be promoted\n", parent->id); - need_nl++; + printf("\n * Configuration specifies '%s' should not be promoted\n", + parent->id); + printed = true; } } - if(managed && crm_is_true(managed) == FALSE) { - printf("%s * The configuration prevents the cluster from stopping or starting '%s' (unmanaged)\n", need_nl == 0?"\n":"", parent->id); - need_nl++; + if (managed && !crm_is_true(managed)) { + printf("%s * Configuration prevents cluster from stopping or starting unmanaged '%s'\n", + (printed? "" : "\n"), parent->id); + printed = true; } free(managed); - if(need_nl) { + if (printed) { printf("\n"); } }