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

Function decode_transition_magic

lib/common/utils.c:830–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830gboolean
831decode_transition_magic(const char *magic, char **uuid, int *transition_id, int *action_id,
832 int *op_status, int *op_rc, int *target_rc)
833{
834 int res = 0;
835 char *key = NULL;
836 gboolean result = TRUE;
837
838 CRM_CHECK(magic != NULL, return FALSE);
839 CRM_CHECK(op_rc != NULL, return FALSE);
840 CRM_CHECK(op_status != NULL, return FALSE);
841
842 key = calloc(1, strlen(magic) + 1);
843 res = sscanf(magic, "%d:%d;%s", op_status, op_rc, key);
844 if (res != 3) {
845 crm_crit("Only found %d items in: %s", res, magic);
846 result = FALSE;
847 goto bail;
848 }
849
850 CRM_CHECK(decode_transition_key(key, uuid, transition_id, action_id, target_rc), result = FALSE;
851 goto bail;
852 );
853
854 bail:
855 free(key);
856 return result;
857}
858
859char *
860generate_transition_key(int transition_id, int action_id, int target_rc, const char *node)

Callers 2

handle_rsc_opFunction · 0.85
sort_op_by_callidFunction · 0.85

Calls 1

decode_transition_keyFunction · 0.85

Tested by

no test coverage detected