| 68 | } |
| 69 | |
| 70 | static char * |
| 71 | convert_non_atomic_uuid(char *old_uuid, resource_t * rsc, gboolean allow_notify, |
| 72 | gboolean free_original) |
| 73 | { |
| 74 | int interval = 0; |
| 75 | char *uuid = NULL; |
| 76 | char *rid = NULL; |
| 77 | char *raw_task = NULL; |
| 78 | int task = no_action; |
| 79 | |
| 80 | pe_rsc_trace(rsc, "Processing %s", old_uuid); |
| 81 | if (old_uuid == NULL) { |
| 82 | return NULL; |
| 83 | |
| 84 | } else if (strstr(old_uuid, "notify") != NULL) { |
| 85 | goto done; /* no conversion */ |
| 86 | |
| 87 | } else if (rsc->variant < pe_group) { |
| 88 | goto done; /* no conversion */ |
| 89 | } |
| 90 | |
| 91 | CRM_ASSERT(parse_op_key(old_uuid, &rid, &raw_task, &interval)); |
| 92 | if (interval > 0) { |
| 93 | goto done; /* no conversion */ |
| 94 | } |
| 95 | |
| 96 | task = text2task(raw_task); |
| 97 | switch (task) { |
| 98 | case stop_rsc: |
| 99 | case start_rsc: |
| 100 | case action_notify: |
| 101 | case action_promote: |
| 102 | case action_demote: |
| 103 | break; |
| 104 | case stopped_rsc: |
| 105 | case started_rsc: |
| 106 | case action_notified: |
| 107 | case action_promoted: |
| 108 | case action_demoted: |
| 109 | task--; |
| 110 | break; |
| 111 | case monitor_rsc: |
| 112 | case shutdown_crm: |
| 113 | case stonith_node: |
| 114 | task = no_action; |
| 115 | break; |
| 116 | default: |
| 117 | crm_err("Unknown action: %s", raw_task); |
| 118 | task = no_action; |
| 119 | break; |
| 120 | } |
| 121 | |
| 122 | if (task != no_action) { |
| 123 | if (is_set(rsc->flags, pe_rsc_notify) && allow_notify) { |
| 124 | uuid = generate_notify_key(rid, "confirmed-post", task2text(task + 1)); |
| 125 | |
| 126 | } else { |
| 127 | uuid = generate_op_key(rid, task2text(task + 1), 0); |
no test coverage detected