diff options
Diffstat (limited to 'lib/common/health.c')
-rw-r--r-- | lib/common/health.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/lib/common/health.c b/lib/common/health.c index ee412be..20cf36e 100644 --- a/lib/common/health.c +++ b/lib/common/health.c @@ -1,5 +1,5 @@ /* - * Copyright 2022 the Pacemaker project contributors + * Copyright 2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -21,11 +21,11 @@ bool pcmk__validate_health_strategy(const char *value) { return pcmk__strcase_any_of(value, - PCMK__VALUE_NONE, - PCMK__VALUE_CUSTOM, - PCMK__VALUE_ONLY_GREEN, - PCMK__VALUE_PROGRESSIVE, - PCMK__VALUE_MIGRATE_ON_RED, + PCMK_VALUE_NONE, + PCMK_VALUE_CUSTOM, + PCMK_VALUE_ONLY_GREEN, + PCMK_VALUE_PROGRESSIVE, + PCMK_VALUE_MIGRATE_ON_RED, NULL); } @@ -40,29 +40,24 @@ pcmk__validate_health_strategy(const char *value) enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value) { - if (pcmk__str_eq(value, PCMK__VALUE_NONE, + if (pcmk__str_eq(value, PCMK_VALUE_NONE, pcmk__str_null_matches|pcmk__str_casei)) { return pcmk__health_strategy_none; - - } else if (pcmk__str_eq(value, PCMK__VALUE_MIGRATE_ON_RED, - pcmk__str_casei)) { + } + if (pcmk__str_eq(value, PCMK_VALUE_MIGRATE_ON_RED, pcmk__str_casei)) { return pcmk__health_strategy_no_red; - - } else if (pcmk__str_eq(value, PCMK__VALUE_ONLY_GREEN, - pcmk__str_casei)) { + } + if (pcmk__str_eq(value, PCMK_VALUE_ONLY_GREEN, pcmk__str_casei)) { return pcmk__health_strategy_only_green; - - } else if (pcmk__str_eq(value, PCMK__VALUE_PROGRESSIVE, - pcmk__str_casei)) { + } + if (pcmk__str_eq(value, PCMK_VALUE_PROGRESSIVE, pcmk__str_casei)) { return pcmk__health_strategy_progressive; - - } else if (pcmk__str_eq(value, PCMK__VALUE_CUSTOM, - pcmk__str_casei)) { + } + if (pcmk__str_eq(value, PCMK_VALUE_CUSTOM, pcmk__str_casei)) { return pcmk__health_strategy_custom; - } else { - pcmk__config_err("Using default of \"" PCMK__VALUE_NONE "\" for " - PCMK__OPT_NODE_HEALTH_STRATEGY + pcmk__config_err("Using default of \"" PCMK_VALUE_NONE "\" for " + PCMK_OPT_NODE_HEALTH_STRATEGY " because '%s' is not a valid value", value); return pcmk__health_strategy_none; |