| 828 | } |
| 829 | |
| 830 | gboolean |
| 831 | decode_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 | |
| 859 | char * |
| 860 | generate_transition_key(int transition_id, int action_id, int target_rc, const char *node) |
no test coverage detected