commit 6de9bff49d55a5e03f3aac134fa651da02acc805
Author: Andrew Beekhof <andrew@beekhof.net>
Date: Thu Aug 8 10:07:43 2013 +1000
Refactor: Reduce duplication by merging the lrmd_exec_rc enum with ocf_exitcode
(cherry picked from commit 7c87227849a589b65eb4864fae2811d9cc39bc1b)
diff --git a/crmd/lrm.c b/crmd/lrm.c
index 5f4d3bb..318c7f8 100644
--- a/crmd/lrm.c
+++ b/crmd/lrm.c
@@ -691,20 +691,20 @@ is_rsc_active(lrm_state_t * lrm_state, const char *rsc_id)
crm_trace("Processing %s: %s.%d=%d",
rsc_id, entry->last->op_type, entry->last->interval, entry->last->rc);
- if (entry->last->rc == PCMK_EXECRA_OK && safe_str_eq(entry->last->op_type, CRMD_ACTION_STOP)) {
+ if (entry->last->rc == PCMK_OCF_OK && safe_str_eq(entry->last->op_type, CRMD_ACTION_STOP)) {
return FALSE;
- } else if (entry->last->rc == PCMK_EXECRA_OK
+ } else if (entry->last->rc == PCMK_OCF_OK
&& safe_str_eq(entry->last->op_type, CRMD_ACTION_MIGRATE)) {
/* a stricter check is too complex...
* leave that to the PE
*/
return FALSE;
- } else if (entry->last->rc == PCMK_EXECRA_NOT_RUNNING) {
+ } else if (entry->last->rc == PCMK_OCF_NOT_RUNNING) {
return FALSE;
- } else if (entry->last->interval == 0 && entry->last->rc == PCMK_EXECRA_NOT_CONFIGURED) {
+ } else if (entry->last->interval == 0 && entry->last->rc == PCMK_OCF_NOT_CONFIGURED) {
/* Badly configured resources can't be reliably stopped */
return FALSE;
}
@@ -812,10 +812,10 @@ notify_deleted(lrm_state_t * lrm_state, ha_msg_input_t * input, const char *rsc_
if (rc == pcmk_ok) {
op->op_status = PCMK_LRM_OP_DONE;
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
op->op_status = PCMK_LRM_OP_ERROR;
- op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ op->rc = PCMK_OCF_UNKNOWN_ERROR;
}
send_direct_ack(from_host, from_sys, NULL, op, rsc_id);
@@ -1295,7 +1295,7 @@ do_lrm_invoke(long long action,
}
op->interval = 0;
op->op_status = PCMK_LRM_OP_DONE;
- op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ op->rc = PCMK_OCF_UNKNOWN_ERROR;
op->t_run = time(NULL);
op->t_rcchange = op->t_run;
@@ -1313,7 +1313,7 @@ do_lrm_invoke(long long action,
crm_info("Failing resource %s...", rsc->id);
process_lrm_event(lrm_state, op);
op->op_status = PCMK_LRM_OP_DONE;
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
lrmd_free_rsc_info(rsc);
} else {
crm_info("Cannot find/create resource in order to fail it...");
@@ -1425,7 +1425,7 @@ do_lrm_invoke(long long action,
op = construct_op(lrm_state, input->xml, ID(xml_rsc), operation);
op->op_status = PCMK_LRM_OP_DONE;
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
CRM_ASSERT(op != NULL);
send_direct_ack(from_host, from_sys, NULL, op, ID(xml_rsc));
lrmd_free_event(op);
@@ -1486,7 +1486,7 @@ do_lrm_invoke(long long action,
g_hash_table_remove(lrm_state->pending_ops, op_key);
}
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
op->op_status = PCMK_LRM_OP_DONE;
send_direct_ack(from_host, from_sys, rsc, op, rsc->id);
@@ -1509,9 +1509,9 @@ do_lrm_invoke(long long action,
op->op_status = PCMK_LRM_OP_ERROR;
if (cib_rc == -EACCES) {
- op->rc = PCMK_EXECRA_INSUFFICIENT_PRIV;
+ op->rc = PCMK_OCF_INSUFFICIENT_PRIV;
} else {
- op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ op->rc = PCMK_OCF_UNKNOWN_ERROR;
}
send_direct_ack(from_host, from_sys, NULL, op, rsc->id);
lrmd_free_event(op);
@@ -2046,7 +2046,7 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op)
}
if (op->op_status == PCMK_LRM_OP_ERROR
- && (op->rc == PCMK_EXECRA_RUNNING_MASTER || op->rc == PCMK_EXECRA_NOT_RUNNING)) {
+ && (op->rc == PCMK_OCF_RUNNING_MASTER || op->rc == PCMK_OCF_NOT_RUNNING)) {
/* Leave it up to the TE/PE to decide if this is an error */
op->op_status = PCMK_LRM_OP_DONE;
log_level = LOG_INFO;
@@ -2096,7 +2096,7 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op)
do_crm_log(log_level,
"LRM operation %s (call=%d, rc=%d, cib-update=%d, confirmed=%s) %s",
op_key, op->call_id, op->rc, update_id, removed ? "true" : "false",
- lrmd_event_rc2str(op->rc));
+ services_ocf_exitcode_str(op->rc));
} else {
do_crm_log(log_level,
"LRM operation %s (call=%d, status=%d, cib-update=%d, confirmed=%s) %s",
diff --git a/crmd/remote_lrmd_ra.c b/crmd/remote_lrmd_ra.c
index 42ea043..fbb9ecb 100644
--- a/crmd/remote_lrmd_ra.c
+++ b/crmd/remote_lrmd_ra.c
@@ -211,7 +211,7 @@ retry_start_cmd_cb(gpointer data)
}
if (rc != 0) {
- cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
cmd->op_status = PCMK_LRM_OP_ERROR;
report_remote_ra_result(cmd);
@@ -236,7 +236,7 @@ monitor_timeout_cb(gpointer data)
crm_debug("Poke async response timed out for node %s", cmd->rsc_id);
cmd->monitor_timeout_id = 0;
cmd->op_status = PCMK_LRM_OP_TIMEOUT;
- cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
lrm_state = lrm_state_find(cmd->rsc_id);
if (lrm_state && lrm_state->remote_ra_data) {
@@ -291,7 +291,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
lrmd_event_type2str(op->type),
op->remote_nodename,
op->op_type ? op->op_type : "none",
- lrmd_event_rc2str(op->rc), services_lrm_status_str(op->op_status));
+ services_ocf_exitcode_str(op->rc), services_lrm_status_str(op->op_status));
/* filter all EXEC events up */
if (op->type == lrmd_event_exec_complete) {
@@ -329,7 +329,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
cmd->remaining_timeout);
}
cmd->op_status = PCMK_LRM_OP_TIMEOUT;
- cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
} else {
/* make sure we have a clean status section to start with */
@@ -338,7 +338,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
erase_status_tag(lrm_state->node_name, XML_CIB_TAG_LRM, cib_scope_local);
erase_status_tag(lrm_state->node_name, XML_TAG_TRANSIENT_NODEATTRS, cib_scope_local);
- cmd->rc = PCMK_EXECRA_OK;
+ cmd->rc = PCMK_OCF_OK;
cmd->op_status = PCMK_LRM_OP_DONE;
}
@@ -361,7 +361,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
* For this function, if we get the poke pack, it is always a success. Pokes
* only fail if the send fails, or the response times out. */
if (!cmd->reported_success) {
- cmd->rc = PCMK_EXECRA_OK;
+ cmd->rc = PCMK_OCF_OK;
cmd->op_status = PCMK_LRM_OP_DONE;
report_remote_ra_result(cmd);
cmd->reported_success = 1;
@@ -442,7 +442,7 @@ handle_remote_ra_exec(gpointer user_data)
return TRUE;
} else {
crm_debug("connect failed, not expecting to match any connection event later");
- cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
cmd->op_status = PCMK_LRM_OP_ERROR;
}
report_remote_ra_result(cmd);
@@ -452,13 +452,13 @@ handle_remote_ra_exec(gpointer user_data)
if (lrm_state_is_connected(lrm_state) == TRUE) {
rc = lrm_state_poke_connection(lrm_state);
if (rc < 0) {
- cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
cmd->op_status = PCMK_LRM_OP_ERROR;
}
} else {
rc = -1;
cmd->op_status = PCMK_LRM_OP_DONE;
- cmd->rc = PCMK_EXECRA_NOT_RUNNING;
+ cmd->rc = PCMK_OCF_NOT_RUNNING;
}
if (rc == 0) {
@@ -471,7 +471,7 @@ handle_remote_ra_exec(gpointer user_data)
} else if (!strcmp(cmd->action, "stop")) {
lrm_state_disconnect(lrm_state);
- cmd->rc = PCMK_EXECRA_OK;
+ cmd->rc = PCMK_OCF_OK;
cmd->op_status = PCMK_LRM_OP_DONE;
if (ra_data->cmds) {
@@ -486,7 +486,7 @@ handle_remote_ra_exec(gpointer user_data)
} else if (!strcmp(cmd->action, "migrate_to")) {
/* no-op. */
- cmd->rc = PCMK_EXECRA_OK;
+ cmd->rc = PCMK_OCF_OK;
cmd->op_status = PCMK_LRM_OP_DONE;
report_remote_ra_result(cmd);
}
diff --git a/crmd/te_actions.c b/crmd/te_actions.c
index b533f58..63d15bb 100644
--- a/crmd/te_actions.c
+++ b/crmd/te_actions.c
@@ -465,7 +465,7 @@ te_rsc_command(crm_graph_t * graph, crm_action_t * action)
&& safe_str_neq(task, CRMD_ACTION_DELETE)) {
/* write a "pending" entry to the CIB, inhibit notification */
crm_debug("Recording pending op %s in the CIB", task_uuid);
- cib_action_update(action, PCMK_LRM_OP_PENDING, PCMK_EXECRA_STATUS_UNKNOWN);
+ cib_action_update(action, PCMK_LRM_OP_PENDING, PCMK_OCF_STATUS_UNKNOWN);
}
return TRUE;
diff --git a/crmd/te_callbacks.c b/crmd/te_callbacks.c
index 3d923b2..c0360b4 100644
--- a/crmd/te_callbacks.c
+++ b/crmd/te_callbacks.c
@@ -548,8 +548,8 @@ action_timer_callback(gpointer data)
}
if (send_update) {
- /* cib_action_update(timer->action, PCMK_LRM_OP_PENDING, PCMK_EXECRA_STATUS_UNKNOWN); */
- cib_action_update(timer->action, PCMK_LRM_OP_TIMEOUT, PCMK_EXECRA_UNKNOWN_ERROR);
+ /* cib_action_update(timer->action, PCMK_LRM_OP_PENDING, PCMK_OCF_STATUS_UNKNOWN); */
+ cib_action_update(timer->action, PCMK_LRM_OP_TIMEOUT, PCMK_OCF_UNKNOWN_ERROR);
}
}
diff --git a/crmd/te_events.c b/crmd/te_events.c
index bc474bd..78d00dd 100644
--- a/crmd/te_events.c
+++ b/crmd/te_events.c
@@ -540,7 +540,7 @@ process_graph_event(xmlNode * event, const char *event_node)
desc = "failed";
}
crm_info("Detected action (%d.%d) %s.%d=%s: %s", transition_num, action, id, callid,
- lrmd_event_rc2str(rc), desc);
+ services_ocf_exitcode_str(rc), desc);
}
bail:
diff --git a/fencing/commands.c b/fencing/commands.c
index 7ef003d..7d04952 100644
--- a/fencing/commands.c
+++ b/fencing/commands.c
@@ -224,7 +224,7 @@ stonith_device_execute(stonith_device_t * device)
} else {
crm_err("failed to get secrets for %s, "
"considering resource not configured", device->id);
- exec_rc = PCMK_EXECRA_NOT_CONFIGURED;
+ exec_rc = PCMK_OCF_NOT_CONFIGURED;
cmd->done_cb(0, exec_rc, NULL, cmd);
return TRUE;
}
diff --git a/include/crm/lrmd.h b/include/crm/lrmd.h
index f627373..b8c3167 100644
--- a/include/crm/lrmd.h
+++ b/include/crm/lrmd.h
@@ -22,6 +22,7 @@
* \brief Local Resource Manager
* \ingroup lrm
*/
+#include <crm/services.h>
#ifndef LRMD__H
# define LRMD__H
@@ -166,21 +167,6 @@ enum lrmd_callback_event {
lrmd_event_poke,
};
-enum lrmd_exec_rc {
- PCMK_EXECRA_OK = 0,
- PCMK_EXECRA_UNKNOWN_ERROR = 1,
- PCMK_EXECRA_INVALID_PARAM = 2,
- PCMK_EXECRA_UNIMPLEMENT_FEATURE = 3,
- PCMK_EXECRA_INSUFFICIENT_PRIV = 4,
- PCMK_EXECRA_NOT_INSTALLED = 5,
- PCMK_EXECRA_NOT_CONFIGURED = 6,
- PCMK_EXECRA_NOT_RUNNING = 7,
- PCMK_EXECRA_RUNNING_MASTER = 8,
- PCMK_EXECRA_FAILED_MASTER = 9,
-
- /* For status command only */
- PCMK_EXECRA_STATUS_UNKNOWN = 14,
-};
/* *INDENT-ON* */
typedef struct lrmd_event_data_s {
@@ -205,8 +191,8 @@ typedef struct lrmd_event_data_s {
/*! This operation that just completed is on a deleted rsc. */
int rsc_deleted;
- /*! The executed ra return code */
- enum lrmd_exec_rc rc;
+ /*! The executed ra return code mapped to OCF */
+ enum ocf_exitcode rc;
/*! The lrmd status returned for exec_complete events */
int op_status;
/*! stdout from resource agent operation */
@@ -448,38 +434,6 @@ struct lrmd_s {
};
static inline const char *
-lrmd_event_rc2str(enum lrmd_exec_rc rc)
-{
- switch (rc) {
- case PCMK_EXECRA_OK:
- return "ok";
- case PCMK_EXECRA_UNKNOWN_ERROR:
- return "unknown error";
- case PCMK_EXECRA_INVALID_PARAM:
- return "invalid parameter";
- case PCMK_EXECRA_UNIMPLEMENT_FEATURE:
- return "unimplemented feature";
- case PCMK_EXECRA_INSUFFICIENT_PRIV:
- return "insufficient privileges";
- case PCMK_EXECRA_NOT_INSTALLED:
- return "not installed";
- case PCMK_EXECRA_NOT_CONFIGURED:
- return "not configured";
- case PCMK_EXECRA_NOT_RUNNING:
- return "not running";
- case PCMK_EXECRA_RUNNING_MASTER:
- return "master";
- case PCMK_EXECRA_FAILED_MASTER:
- return "master (failed)";
- case PCMK_EXECRA_STATUS_UNKNOWN:
- return "status: unknown";
- default:
- break;
- }
- return "<unknown>";
-}
-
-static inline const char *
lrmd_event_type2str(enum lrmd_callback_event type)
{
switch (type) {
diff --git a/include/crm/services.h b/include/crm/services.h
index fb5c6b0..0c0cca9 100644
--- a/include/crm/services.h
+++ b/include/crm/services.h
@@ -31,6 +31,7 @@ extern "C" {
# include <glib.h>
# include <stdio.h>
+# include <string.h>
# ifndef OCF_ROOT_DIR
# define OCF_ROOT_DIR "/usr/lib/ocf"
@@ -59,34 +60,22 @@ enum lsb_exitcode {
PCMK_LSB_NOT_INSTALLED = 5,
PCMK_LSB_NOT_CONFIGURED = 6,
PCMK_LSB_NOT_RUNNING = 7,
-
- /* 150-199 reserved for application use */
- PCMK_LSB_SIGNAL = 194,
- PCMK_LSB_NOT_SUPPORTED = 195,
- PCMK_LSB_PENDING = 196,
- PCMK_LSB_CANCELLED = 197,
- PCMK_LSB_TIMEOUT = 198,
- PCMK_LSB_OTHER_ERROR = 199,
};
/* The return codes for the status operation are not the same for other
- * operatios - go figure */
+ * operatios - go figure
+ */
enum lsb_status_exitcode {
PCMK_LSB_STATUS_OK = 0,
PCMK_LSB_STATUS_VAR_PID = 1,
PCMK_LSB_STATUS_VAR_LOCK = 2,
PCMK_LSB_STATUS_NOT_RUNNING = 3,
PCMK_LSB_STATUS_NOT_INSTALLED = 4,
-
- /* 150-199 reserved for application use */
- PCMK_LSB_STATUS_SIGNAL = 194,
- PCMK_LSB_STATUS_NOT_SUPPORTED = 195,
- PCMK_LSB_STATUS_PENDING = 196,
- PCMK_LSB_STATUS_CANCELLED = 197,
- PCMK_LSB_STATUS_TIMEOUT = 198,
- PCMK_LSB_STATUS_OTHER_ERROR = 199,
};
+/* Uniform exit codes
+ * Everything is mapped to its OCF equivalent so that Pacemaker only deals with one set of codes
+ */
enum ocf_exitcode {
PCMK_OCF_OK = 0,
PCMK_OCF_UNKNOWN_ERROR = 1,
@@ -95,10 +84,12 @@ enum ocf_exitcode {
PCMK_OCF_INSUFFICIENT_PRIV = 4,
PCMK_OCF_NOT_INSTALLED = 5,
PCMK_OCF_NOT_CONFIGURED = 6,
- PCMK_OCF_NOT_RUNNING = 7,
+ PCMK_OCF_NOT_RUNNING = 7, /* End of overlap with LSB */
PCMK_OCF_RUNNING_MASTER = 8,
PCMK_OCF_FAILED_MASTER = 9,
+ PCMK_OCF_STATUS_UNKNOWN = 14, /* Already in use */
+
/* 150-199 reserved for application use */
PCMK_OCF_SIGNAL = 194,
PCMK_OCF_NOT_SUPPORTED = 195,
@@ -114,7 +105,7 @@ enum op_status {
PCMK_LRM_OP_CANCELLED,
PCMK_LRM_OP_TIMEOUT,
PCMK_LRM_OP_NOTSUPPORTED,
- PCMK_LRM_OP_ERROR
+ PCMK_LRM_OP_ERROR,
};
enum nagios_exitcode {
@@ -276,25 +267,25 @@ enum nagios_exitcode {
}} static inline const char *services_ocf_exitcode_str(enum ocf_exitcode code) {
switch (code) {
case PCMK_OCF_OK:
- return "OCF_OK";
+ return "ok";
case PCMK_OCF_UNKNOWN_ERROR:
- return "OCF_UNKNOWN_ERROR";
+ return "unknown error";
case PCMK_OCF_INVALID_PARAM:
- return "OCF_INVALID_PARAM";
+ return "invalid parameter";
case PCMK_OCF_UNIMPLEMENT_FEATURE:
- return "OCF_UNIMPLEMENT_FEATURE";
+ return "unimplemented feature";
case PCMK_OCF_INSUFFICIENT_PRIV:
- return "OCF_INSUFFICIENT_PRIV";
+ return "insufficient privileges";
case PCMK_OCF_NOT_INSTALLED:
- return "OCF_NOT_INSTALLED";
+ return "not installed";
case PCMK_OCF_NOT_CONFIGURED:
- return "OCF_NOT_CONFIGURED";
+ return "not configured";
case PCMK_OCF_NOT_RUNNING:
- return "OCF_NOT_RUNNING";
+ return "not running";
case PCMK_OCF_RUNNING_MASTER:
- return "OCF_RUNNING_MASTER";
+ return "master";
case PCMK_OCF_FAILED_MASTER:
- return "OCF_FAILED_MASTER";
+ return "master (failed)";
case PCMK_OCF_SIGNAL:
return "OCF_SIGNAL";
case PCMK_OCF_NOT_SUPPORTED:
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
index 26cecb2..78ceb85 100644
--- a/lib/pengine/unpack.c
+++ b/lib/pengine/unpack.c
@@ -2205,8 +2205,8 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
task_status_i = PCMK_LRM_OP_ERROR;
pe_rsc_debug(rsc, "%s on %s returned %d (%s) instead of the expected value: %d (%s)",
id, node->details->uname,
- actual_rc_i, lrmd_event_rc2str(actual_rc_i),
- target_rc, lrmd_event_rc2str(target_rc));
+ actual_rc_i, services_ocf_exitcode_str(actual_rc_i),
+ target_rc, services_ocf_exitcode_str(target_rc));
}
} else if (task_status_i == PCMK_LRM_OP_ERROR) {
@@ -2215,7 +2215,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
}
if (task_status_i == PCMK_LRM_OP_NOTSUPPORTED) {
- actual_rc_i = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
+ actual_rc_i = PCMK_OCF_UNIMPLEMENT_FEATURE;
}
if (expired) {
@@ -2254,8 +2254,8 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
}
if (expired
- && actual_rc_i != PCMK_EXECRA_NOT_RUNNING
- && actual_rc_i != PCMK_EXECRA_RUNNING_MASTER && actual_rc_i != PCMK_EXECRA_OK) {
+ && actual_rc_i != PCMK_OCF_NOT_RUNNING
+ && actual_rc_i != PCMK_OCF_RUNNING_MASTER && actual_rc_i != PCMK_OCF_OK) {
if(interval == 0) {
crm_notice("Ignoring expired failure %s (rc=%d, magic=%s) on %s",
id, actual_rc_i, magic, node->details->uname);
@@ -2273,7 +2273,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
* didnt include target_rc and liked to remap status
*/
switch (actual_rc_i) {
- case PCMK_EXECRA_NOT_RUNNING:
+ case PCMK_OCF_NOT_RUNNING:
if (is_probe || target_rc == actual_rc_i) {
task_status_i = PCMK_LRM_OP_DONE;
rsc->role = RSC_ROLE_STOPPED;
@@ -2287,7 +2287,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
}
break;
- case PCMK_EXECRA_RUNNING_MASTER:
+ case PCMK_OCF_RUNNING_MASTER:
if (is_probe) {
task_status_i = PCMK_LRM_OP_DONE;
crm_notice("Operation %s found resource %s active in master mode on %s",
@@ -2311,42 +2311,42 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
rsc->role = RSC_ROLE_MASTER;
break;
- case PCMK_EXECRA_FAILED_MASTER:
+ case PCMK_OCF_FAILED_MASTER:
rsc->role = RSC_ROLE_MASTER;
task_status_i = PCMK_LRM_OP_ERROR;
break;
- case PCMK_EXECRA_UNIMPLEMENT_FEATURE:
+ case PCMK_OCF_UNIMPLEMENT_FEATURE:
if (interval > 0) {
task_status_i = PCMK_LRM_OP_NOTSUPPORTED;
break;
}
/* else: fall through */
- case PCMK_EXECRA_INSUFFICIENT_PRIV:
- case PCMK_EXECRA_NOT_INSTALLED:
- case PCMK_EXECRA_INVALID_PARAM:
+ case PCMK_OCF_INSUFFICIENT_PRIV:
+ case PCMK_OCF_NOT_INSTALLED:
+ case PCMK_OCF_INVALID_PARAM:
effective_node = node;
if(pe_can_fence(data_set, node) == FALSE
&& safe_str_eq(task, CRMD_ACTION_STOP)) {
/* If a stop fails and we can't fence, there's nothing else we can do */
pe_proc_err("No further recovery can be attempted for %s: %s action failed with '%s' (%d)",
- rsc->id, task, lrmd_event_rc2str(actual_rc_i), actual_rc_i);
+ rsc->id, task, services_ocf_exitcode_str(actual_rc_i), actual_rc_i);
clear_bit(rsc->flags, pe_rsc_managed);
set_bit(rsc->flags, pe_rsc_block);
}
/* fall through */
- case PCMK_EXECRA_NOT_CONFIGURED:
+ case PCMK_OCF_NOT_CONFIGURED:
failed = rsc;
if (is_not_set(rsc->flags, pe_rsc_unique)) {
failed = uber_parent(failed);
}
- do_crm_log(actual_rc_i == PCMK_EXECRA_NOT_INSTALLED ? LOG_NOTICE : LOG_ERR,
+ do_crm_log(actual_rc_i == PCMK_OCF_NOT_INSTALLED ? LOG_NOTICE : LOG_ERR,
"Preventing %s from re-starting %s %s: operation %s failed '%s' (rc=%d)",
failed->id,
effective_node ? "on" : "anywhere in the cluster",
effective_node ? effective_node->details->uname : "",
- task, lrmd_event_rc2str(actual_rc_i), actual_rc_i);
+ task, services_ocf_exitcode_str(actual_rc_i), actual_rc_i);
resource_location(failed, effective_node, -INFINITY, "hard-error", data_set);
if (is_probe) {
@@ -2354,7 +2354,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
task = CRMD_ACTION_STOP;
task_status_i = PCMK_LRM_OP_DONE;
crm_xml_add(xml_op, XML_ATTR_UNAME, node->details->uname);
- if (actual_rc_i != PCMK_EXECRA_NOT_INSTALLED
+ if (actual_rc_i != PCMK_OCF_NOT_INSTALLED
|| is_set(data_set->flags, pe_flag_symmetric_cluster)) {
if ((node->details->shutdown == FALSE) || (node->details->online == TRUE)) {
add_node_copy(data_set->failed, xml_op);
@@ -2363,7 +2363,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
}
break;
- case PCMK_EXECRA_OK:
+ case PCMK_OCF_OK:
if (is_probe && target_rc == 7) {
task_status_i = PCMK_LRM_OP_DONE;
pe_rsc_info(rsc, "Operation %s found resource %s active on %s",
@@ -2447,7 +2447,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
case PCMK_LRM_OP_DONE:
pe_rsc_trace(rsc, "%s/%s completed on %s", rsc->id, task, node->details->uname);
- if (actual_rc_i == PCMK_EXECRA_NOT_RUNNING) {
+ if (actual_rc_i == PCMK_OCF_NOT_RUNNING) {
clear_past_failure = TRUE;
} else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
@@ -2519,7 +2519,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ID(migrate_from), migrate_target, from_status, from_rc);
}
- if (migrate_from && from_rc == PCMK_EXECRA_OK
+ if (migrate_from && from_rc == PCMK_OCF_OK
&& from_status == PCMK_LRM_OP_DONE) {
pe_rsc_trace(rsc, "Detected dangling migration op: %s on %s", ID(xml_op),
migrate_source);
@@ -2603,7 +2603,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
case PCMK_LRM_OP_TIMEOUT:
case PCMK_LRM_OP_NOTSUPPORTED:
crm_warn("Processing failed op %s for %s on %s: %s (%d)",
- task, rsc->id, node->details->uname, lrmd_event_rc2str(actual_rc_i),
+ task, rsc->id, node->details->uname, services_ocf_exitcode_str(actual_rc_i),
actual_rc_i);
crm_xml_add(xml_op, XML_ATTR_UNAME, node->details->uname);
if ((node->details->shutdown == FALSE) || (node->details->online == TRUE)) {
diff --git a/lib/services/systemd.c b/lib/services/systemd.c
index 74cf53e..783caca 100644
--- a/lib/services/systemd.c
+++ b/lib/services/systemd.c
@@ -381,10 +381,10 @@ systemd_unit_exec_done(GObject * source_object, GAsyncResult * res, gpointer use
if (safe_str_eq(op->action, "stop")) {
crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
- op->rc = PCMK_EXECRA_NOT_INSTALLED;
+ op->rc = PCMK_OCF_NOT_INSTALLED;
}
} else {
@@ -398,11 +398,11 @@ systemd_unit_exec_done(GObject * source_object, GAsyncResult * res, gpointer use
g_variant_get(_ret, "(o)", &path);
crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
path);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
}
operation_finalize(op);
@@ -423,7 +423,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
const char *action = op->action;
char *name = systemd_service_name(op->agent);
- op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ op->rc = PCMK_OCF_UNKNOWN_ERROR;
CRM_ASSERT(systemd_init());
crm_debug("Performing %ssynchronous %s op on systemd unit %s named '%s'",
@@ -431,7 +431,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
if (safe_str_eq(op->action, "meta-data")) {
op->stdout_data = systemd_unit_metadata(op->agent);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
goto cleanup;
}
@@ -440,7 +440,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
crm_debug("Could not obtain unit named '%s': %s", op->agent,
error ? error->message : "unknown");
if (error && strstr(error->message, "systemd1.NoSuchUnit")) {
- op->rc = PCMK_EXECRA_NOT_INSTALLED;
+ op->rc = PCMK_OCF_NOT_INSTALLED;
}
if(error) {
g_error_free(error);
@@ -452,9 +452,9 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
char *state = systemd_unit_property(unit, BUS_NAME ".Unit", "ActiveState");
if (g_strcmp0(state, "active") == 0) {
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
- op->rc = PCMK_EXECRA_NOT_RUNNING;
+ op->rc = PCMK_OCF_NOT_RUNNING;
}
free(state);
@@ -504,7 +504,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
} else if (g_strcmp0(action, "restart") == 0) {
action = "RestartUnit";
} else {
- op->rc = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
+ op->rc = PCMK_OCF_UNIMPLEMENT_FEATURE;
goto cleanup;
}
@@ -525,7 +525,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
if (safe_str_eq(op->action, "stop")
&& strstr(error->message, "systemd1.InvalidName")) {
crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Could not issue %s for %s: %s (%s)", action, op->rsc, error->message, unit);
}
@@ -537,11 +537,11 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
g_variant_get(_ret, "(o)", &path);
crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
path);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
}
cleanup:
@@ -555,5 +555,5 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
operation_finalize(op);
return TRUE;
}
- return op->rc == PCMK_EXECRA_OK;
+ return op->rc == PCMK_OCF_OK;
}
diff --git a/lib/services/upstart.c b/lib/services/upstart.c
index f5fa189..daeb398 100644
--- a/lib/services/upstart.c
+++ b/lib/services/upstart.c
@@ -384,12 +384,12 @@ upstart_job_exec_done(GObject * source_object, GAsyncResult * res, gpointer user
if (safe_str_eq(op->action, "start")
&& strstr(error->message, BUS_MANAGER_IFACE ".Error.AlreadyStarted")) {
crm_trace("Masking Start failure for %s: already started", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else if (safe_str_eq(op->action, "stop")
&& strstr(error->message, BUS_MANAGER_IFACE ".Error.UnknownInstance")) {
crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Could not issue %s for %s: %s", op->action, op->rsc, error->message);
}
@@ -401,11 +401,11 @@ upstart_job_exec_done(GObject * source_object, GAsyncResult * res, gpointer user
g_variant_get(_ret, "(o)", &path);
crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
path);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
}
operation_finalize(op);
@@ -427,12 +427,12 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
GVariant *_ret = NULL;
GDBusProxy *job_proxy = NULL;
- op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ op->rc = PCMK_OCF_UNKNOWN_ERROR;
CRM_ASSERT(upstart_init());
if (safe_str_eq(op->action, "meta-data")) {
op->stdout_data = upstart_job_metadata(op->agent);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
goto cleanup;
}
@@ -443,18 +443,18 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
}
if (pass == FALSE) {
if (!g_strcmp0(action, "stop")) {
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
- op->rc = PCMK_EXECRA_NOT_INSTALLED;
+ op->rc = PCMK_OCF_NOT_INSTALLED;
}
goto cleanup;
}
if (safe_str_eq(op->action, "monitor") || safe_str_eq(action, "status")) {
if (upstart_job_running(op->agent)) {
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
- op->rc = PCMK_EXECRA_NOT_RUNNING;
+ op->rc = PCMK_OCF_NOT_RUNNING;
}
goto cleanup;
@@ -465,7 +465,7 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
} else if (!g_strcmp0(action, "restart")) {
action = "Restart";
} else {
- op->rc = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
+ op->rc = PCMK_OCF_UNIMPLEMENT_FEATURE;
goto cleanup;
}
@@ -487,11 +487,11 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
if (safe_str_eq(action, "Start")
&& strstr(error->message, BUS_MANAGER_IFACE ".Error.AlreadyStarted")) {
crm_trace("Masking Start failure for %s: already started", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else if (safe_str_eq(action, "Stop")
&& strstr(error->message, BUS_MANAGER_IFACE ".Error.UnknownInstance")) {
crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Could not issue %s for %s: %s (%s)", action, op->rsc, error->message, job);
}
@@ -502,11 +502,11 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
g_variant_get(_ret, "(o)", &path);
crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
path);
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
} else {
crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
- op->rc = PCMK_EXECRA_OK;
+ op->rc = PCMK_OCF_OK;
}
cleanup:
@@ -524,5 +524,5 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
operation_finalize(op);
return TRUE;
}
- return op->rc == PCMK_EXECRA_OK;
+ return op->rc == PCMK_OCF_OK;
}
diff --git a/lrmd/lrmd.c b/lrmd/lrmd.c
index b5bbea0..8592b6c 100644
--- a/lrmd/lrmd.c
+++ b/lrmd/lrmd.c
@@ -460,38 +460,38 @@ static int
lsb2uniform_rc(const char *action, int rc)
{
if (rc < 0) {
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
/* status has different return codes that everything else. */
if (!safe_str_eq(action, "status") && !safe_str_eq(action, "monitor")) {
if (rc > PCMK_LSB_NOT_RUNNING) {
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
return rc;
}
switch (rc) {
case PCMK_LSB_STATUS_OK:
- return PCMK_EXECRA_OK;
+ return PCMK_OCF_OK;
case PCMK_LSB_STATUS_NOT_INSTALLED:
- return PCMK_EXECRA_NOT_INSTALLED;
+ return PCMK_OCF_NOT_INSTALLED;
case PCMK_LSB_STATUS_VAR_PID:
case PCMK_LSB_STATUS_VAR_LOCK:
case PCMK_LSB_STATUS_NOT_RUNNING:
- return PCMK_EXECRA_NOT_RUNNING;
+ return PCMK_OCF_NOT_RUNNING;
default:
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
static int
ocf2uniform_rc(int rc)
{
if (rc < 0 || rc > PCMK_OCF_FAILED_MASTER) {
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
return rc;
@@ -502,14 +502,14 @@ stonith2uniform_rc(const char *action, int rc)
{
if (rc == -ENODEV) {
if (safe_str_eq(action, "stop")) {
- rc = PCMK_EXECRA_OK;
+ rc = PCMK_OCF_OK;
} else if (safe_str_eq(action, "start")) {
- rc = PCMK_EXECRA_NOT_INSTALLED;
+ rc = PCMK_OCF_NOT_INSTALLED;
} else {
- rc = PCMK_EXECRA_NOT_RUNNING;
+ rc = PCMK_OCF_NOT_RUNNING;
}
} else if (rc != 0) {
- rc = PCMK_EXECRA_UNKNOWN_ERROR;
+ rc = PCMK_OCF_UNKNOWN_ERROR;
}
return rc;
}
@@ -519,25 +519,25 @@ static int
nagios2uniform_rc(const char *action, int rc)
{
if (rc < 0) {
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
switch (rc) {
case NAGIOS_STATE_OK:
- return PCMK_EXECRA_OK;
+ return PCMK_OCF_OK;
case NAGIOS_INSUFFICIENT_PRIV:
- return PCMK_EXECRA_INSUFFICIENT_PRIV;
+ return PCMK_OCF_INSUFFICIENT_PRIV;
case NAGIOS_NOT_INSTALLED:
- return PCMK_EXECRA_NOT_INSTALLED;
+ return PCMK_OCF_NOT_INSTALLED;
case NAGIOS_STATE_WARNING:
case NAGIOS_STATE_CRITICAL:
case NAGIOS_STATE_UNKNOWN:
case NAGIOS_STATE_DEPENDENT:
default:
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
- return PCMK_EXECRA_UNKNOWN_ERROR;
+ return PCMK_OCF_UNKNOWN_ERROR;
}
#endif
@@ -605,11 +605,11 @@ action_complete(svc_action_t * action)
#if SUPPORT_NAGIOS
if (rsc && safe_str_eq(rsc->class, "nagios")) {
if (safe_str_eq(cmd->action, "monitor") &&
- cmd->interval == 0 && cmd->exec_rc == PCMK_EXECRA_OK) {
+ cmd->interval == 0 && cmd->exec_rc == PCMK_OCF_OK) {
/* Successfully executed --version for the nagios plugin */
- cmd->exec_rc = PCMK_EXECRA_NOT_RUNNING;
+ cmd->exec_rc = PCMK_OCF_NOT_RUNNING;
- } else if (safe_str_eq(cmd->action, "start") && cmd->exec_rc != PCMK_EXECRA_OK) {
+ } else if (safe_str_eq(cmd->action, "start") && cmd->exec_rc != PCMK_OCF_OK) {
int time_sum = 0;
int timeout_left = 0;
int delay = cmd->timeout_orig / 10;
@@ -841,7 +841,7 @@ lrmd_rsc_execute_service_lib(lrmd_rsc_t * rsc, lrmd_cmd_t * cmd)
#if SUPPORT_NAGIOS
/* Recurring operations are cancelled anyway for a stop operation */
if (safe_str_eq(rsc->class, "nagios") && safe_str_eq(cmd->action, "stop")) {
- cmd->exec_rc = PCMK_EXECRA_OK;
+ cmd->exec_rc = PCMK_OCF_OK;
goto exec_done;
}
#endif
diff --git a/lrmd/test.c b/lrmd/test.c
index 15ffd88..2d8571e 100644
--- a/lrmd/test.c
+++ b/lrmd/test.c
@@ -110,7 +110,7 @@ test_exit(int rc)
lrmd_event_type2str(event->type), \
event->rsc_id, \
event->op_type ? event->op_type : "none", \
- lrmd_event_rc2str(event->rc), \
+ services_ocf_exitcode_str(event->rc), \
services_lrm_status_str(event->op_status)); \
crm_info("%s", event_buf_v0);;
diff --git a/pengine/native.c b/pengine/native.c
index 37f5211..21ad629 100644
--- a/pengine/native.c
+++ b/pengine/native.c
@@ -23,6 +23,7 @@
#include <crm/msg_xml.h>
#include <allocate.h>
#include <utils.h>
+#include <crm/services.h>
/* #define DELETE_THEN_REFRESH 1 // The crmd will remove the resource from the CIB itself, making this redundant */
#define INFINITY_HACK (INFINITY * -100)
@@ -783,7 +784,7 @@ RecurringOp(resource_t * rsc, action_t * start, node_t * node,
}
if (rsc->next_role == RSC_ROLE_MASTER) {
- char *running_master = crm_itoa(PCMK_EXECRA_RUNNING_MASTER);
+ char *running_master = crm_itoa(PCMK_OCF_RUNNING_MASTER);
add_hash_param(mon->meta, XML_ATTR_TE_TARGET_RC, running_master);
free(running_master);
@@ -949,7 +950,7 @@ RecurringOp_Stopped(resource_t * rsc, action_t * start, node_t * node,
stopped_mon = custom_action(rsc, strdup(key), name, stop_node, is_optional, TRUE, data_set);
- rc_inactive = crm_itoa(PCMK_EXECRA_NOT_RUNNING);
+ rc_inactive = crm_itoa(PCMK_OCF_NOT_RUNNING);
add_hash_param(stopped_mon->meta, XML_ATTR_TE_TARGET_RC, rc_inactive);
free(rc_inactive);
@@ -2400,8 +2401,8 @@ native_create_probe(resource_t * rsc, node_t * node, action_t * complete,
static const char *rc_inactive = NULL;
if (rc_inactive == NULL) {
- rc_inactive = crm_itoa(PCMK_EXECRA_NOT_RUNNING);
- rc_master = crm_itoa(PCMK_EXECRA_RUNNING_MASTER);
+ rc_inactive = crm_itoa(PCMK_OCF_NOT_RUNNING);
+ rc_master = crm_itoa(PCMK_OCF_RUNNING_MASTER);
}
CRM_CHECK(node != NULL, return FALSE);
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
index 9d68237..7c6e495 100644
--- a/tools/crm_mon.c
+++ b/tools/crm_mon.c
@@ -950,7 +950,7 @@ print_rsc_history(pe_working_set_t * data_set, node_t * node, xmlNode * rsc_entr
}
}
- print_as(" rc=%s (%s)\n", op_rc, lrmd_event_rc2str(rc));
+ print_as(" rc=%s (%s)\n", op_rc, services_ocf_exitcode_str(rc));
}
/* no need to free the contents */
@@ -1405,11 +1405,11 @@ print_status(pe_working_set_t * data_set)
}
print_as(" %s on %s '%s' (%d): call=%s, status=%s, last-rc-change='%s', queued=%sms, exec=%sms\n",
- op_key ? op_key : id, node, lrmd_event_rc2str(rc), rc, call, services_lrm_status_str(status),
+ op_key ? op_key : id, node, services_ocf_exitcode_str(rc), rc, call, services_lrm_status_str(status),
run_at_s, crm_element_value(xml_op, XML_RSC_OP_T_EXEC), crm_element_value(xml_op, XML_RSC_OP_T_QUEUE));
} else {
print_as(" %s on %s '%s' (%d): call=%s, status=%s\n",
- op_key ? op_key : id, node, lrmd_event_rc2str(rc), rc, call, services_lrm_status_str(status));
+ op_key ? op_key : id, node, services_ocf_exitcode_str(rc), rc, call, services_lrm_status_str(status));
}
}
print_as("\n");
@@ -2135,10 +2135,10 @@ send_smtp_trap(const char *node, const char *rsc, const char *task, int target_r
"\toperation status: (%d) %s\r\n", status, services_lrm_status_str(status));
if (status == PCMK_LRM_OP_DONE) {
len += snprintf(crm_mail_body + len, BODY_MAX - len,
- "\tscript returned: (%d) %s\r\n", rc, lrmd_event_rc2str(rc));
+ "\tscript returned: (%d) %s\r\n", rc, services_ocf_exitcode_str(rc));
len += snprintf(crm_mail_body + len, BODY_MAX - len,
"\texpected return value: (%d) %s\r\n", target_rc,
- lrmd_event_rc2str(target_rc));
+ services_ocf_exitcode_str(target_rc));
}
auth_client_init();
@@ -2274,12 +2274,12 @@ handle_rsc_op(xmlNode * rsc_op)
desc = pcmk_strerror(pcmk_ok);
if (status == PCMK_LRM_OP_DONE && target_rc == rc) {
crm_notice("%s of %s on %s completed: %s", task, rsc, node, desc);
- if (rc == PCMK_EXECRA_NOT_RUNNING) {
+ if (rc == PCMK_OCF_NOT_RUNNING) {
notify = FALSE;
}
} else if (status == PCMK_LRM_OP_DONE) {
- desc = lrmd_event_rc2str(rc);
+ desc = services_ocf_exitcode_str(rc);
crm_warn("%s of %s on %s failed: %s", task, rsc, node, desc);
} else {