MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / unpack_rsc_op

Function unpack_rsc_op

lib/pengine/unpack.c:1611–2193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1609}
1610
1611gboolean
1612unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
1613 enum action_fail_response * on_fail, pe_working_set_t * data_set)
1614{
1615 int task_id = 0;
1616
1617 const char *id = NULL;
1618 const char *key = NULL;
1619 const char *task = NULL;
1620 const char *task_key = NULL;
1621 const char *magic = NULL;
1622 const char *actual_rc = NULL;
1623
1624/* const char *target_rc = NULL; */
1625 const char *task_status = NULL;
1626 const char *interval_s = NULL;
1627 const char *op_version = NULL;
1628
1629 int interval = 0;
1630 int task_status_i = -2;
1631 int actual_rc_i = 0;
1632 int target_rc = -1;
1633 int last_failure = 0;
1634
1635 action_t *action = NULL;
1636 node_t *effective_node = NULL;
1637 resource_t *failed = NULL;
1638
1639 gboolean expired = FALSE;
1640 gboolean is_probe = FALSE;
1641 gboolean clear_past_failure = FALSE;
1642
1643 CRM_CHECK(rsc != NULL, return FALSE);
1644 CRM_CHECK(node != NULL, return FALSE);
1645 CRM_CHECK(xml_op != NULL, return FALSE);
1646
1647 id = ID(xml_op);
1648 task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
1649 task_key = crm_element_value(xml_op, XML_LRM_ATTR_TASK_KEY);
1650 task_status = crm_element_value(xml_op, XML_LRM_ATTR_OPSTATUS);
1651 op_version = crm_element_value(xml_op, XML_ATTR_CRM_VERSION);
1652 magic = crm_element_value(xml_op, XML_ATTR_TRANSITION_MAGIC);
1653 key = crm_element_value(xml_op, XML_ATTR_TRANSITION_KEY);
1654
1655 crm_element_value_int(xml_op, XML_LRM_ATTR_CALLID, &task_id);
1656
1657 CRM_CHECK(id != NULL, return FALSE);
1658 CRM_CHECK(task != NULL, return FALSE);
1659 CRM_CHECK(task_status != NULL, return FALSE);
1660
1661 task_status_i = crm_parse_int(task_status, NULL);
1662
1663 CRM_CHECK(task_status_i <= PCMK_LRM_OP_ERROR, return FALSE);
1664 CRM_CHECK(task_status_i >= PCMK_LRM_OP_PENDING, return FALSE);
1665
1666 if (safe_str_eq(task, CRMD_ACTION_NOTIFY)) {
1667 /* safe to ignore these */
1668 return TRUE;

Callers 1

unpack_lrm_rsc_stateFunction · 0.85

Calls 15

crm_element_valueFunction · 0.85
crm_element_value_intFunction · 0.85
crm_parse_intFunction · 0.85
get_timet_nowFunction · 0.85
role2textFunction · 0.85
decode_transition_keyFunction · 0.85
lrmd_event_rc2strFunction · 0.85
get_failcountFunction · 0.85
custom_actionFunction · 0.85
crm_concatFunction · 0.85
add_hash_paramFunction · 0.85
safe_str_neqFunction · 0.85

Tested by

no test coverage detected