Skip to content

Commit aa7813c

Browse files
committed
API: libcrmcommon: New PCMK_VALUE_STATUS string constant
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent da311b4 commit aa7813c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

daemons/fenced/fenced_commands.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ target_list_type(stonith_device_t * dev)
10651065
} else if (pcmk_is_set(dev->flags, st_device_supports_list)) {
10661066
check_type = PCMK_VALUE_DYNAMIC_LIST;
10671067
} else if (pcmk_is_set(dev->flags, st_device_supports_status)) {
1068-
check_type = "status";
1068+
check_type = PCMK_VALUE_STATUS;
10691069
} else {
10701070
check_type = PCMK_VALUE_NONE;
10711071
}
@@ -1301,12 +1301,13 @@ dynamic_list_search_cb(int pid, const pcmk__action_result_t *result,
13011301
((result->exit_reason == NULL)? "" : ")"));
13021302
}
13031303

1304-
/* Fall back to pcmk_host_check="status" if the user didn't explicitly
1305-
* specify PCMK_VALUE_DYNAMIC_LIST
1304+
/* Fall back to pcmk_host_check=PCMK_VALUE_STATUS if the user didn't
1305+
* explicitly specify PCMK_VALUE_DYNAMIC_LIST
13061306
*/
13071307
if (g_hash_table_lookup(dev->params, PCMK_STONITH_HOST_CHECK) == NULL) {
13081308
crm_notice("Switching to pcmk_host_check='status' for %s", dev->id);
1309-
pcmk__insert_dup(dev->params, PCMK_STONITH_HOST_CHECK, "status");
1309+
pcmk__insert_dup(dev->params, PCMK_STONITH_HOST_CHECK,
1310+
PCMK_VALUE_STATUS);
13101311
}
13111312
}
13121313

@@ -2208,7 +2209,7 @@ can_fence_host_with_device(stonith_device_t *dev,
22082209
can = TRUE;
22092210
}
22102211

2211-
} else if (pcmk__str_eq(check_type, "status", pcmk__str_casei)) {
2212+
} else if (pcmk__str_eq(check_type, PCMK_VALUE_STATUS, pcmk__str_casei)) {
22122213
int device_timeout = get_action_timeout(dev, check_type, search->per_device_timeout);
22132214

22142215
if (device_timeout > search->per_device_timeout) {

include/crm/common/options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ extern "C" {
202202
#define PCMK_VALUE_SERIALIZE "Serialize"
203203
#define PCMK_VALUE_STANDBY "standby"
204204
#define PCMK_VALUE_STATIC_LIST "static-list"
205+
#define PCMK_VALUE_STATUS "status"
205206
#define PCMK_VALUE_STRING "string"
206207
#define PCMK_VALUE_STOP "stop"
207208
#define PCMK_VALUE_SUCCESS "success"

lib/common/options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ static const pcmk__cluster_option_t fence_params[] = {
587587
},
588588
{
589589
PCMK_STONITH_HOST_CHECK, NULL, PCMK_VALUE_SELECT,
590-
PCMK_VALUE_DYNAMIC_LIST ", " PCMK_VALUE_STATIC_LIST ", status, "
591-
"none",
590+
PCMK_VALUE_DYNAMIC_LIST ", " PCMK_VALUE_STATIC_LIST ", "
591+
PCMK_VALUE_STATUS ", " PCMK_VALUE_NONE,
592592
NULL, NULL,
593593
pcmk__opt_none,
594594
N_("How to determine which nodes can be targeted by the device"),

0 commit comments

Comments
 (0)