summaryrefslogtreecommitdiffstats
path: root/tools/stonith_admin.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:52 +0000
commitcbe4cdc48486fbedede448aa59aa6a367efa1038 (patch)
tree6fc30a23fe7642fd93c5c6c702c4bc8ed5640b38 /tools/stonith_admin.c
parentAdding debian version 2.1.6-5. (diff)
downloadpacemaker-cbe4cdc48486fbedede448aa59aa6a367efa1038.tar.xz
pacemaker-cbe4cdc48486fbedede448aa59aa6a367efa1038.zip
Merging upstream version 2.1.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/stonith_admin.c')
-rw-r--r--tools/stonith_admin.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/stonith_admin.c b/tools/stonith_admin.c
index 1077de7..01f72d5 100644
--- a/tools/stonith_admin.c
+++ b/tools/stonith_admin.c
@@ -344,7 +344,11 @@ request_fencing(stonith_t *st, const char *target, const char *command,
if (rc != pcmk_rc_ok) {
const char *rc_str = pcmk_rc_str(rc);
- const char *what = (strcmp(command, "on") == 0)? "unfence" : "fence";
+ const char *what = "fence";
+
+ if (strcmp(command, PCMK_ACTION_ON) == 0) {
+ what = "unfence";
+ }
// If reason is identical to return code string, don't display it twice
if (pcmk__str_eq(rc_str, reason, pcmk__str_none)) {
@@ -542,7 +546,7 @@ main(int argc, char **argv)
case 'I':
rc = pcmk__fence_installed(out, st, options.timeout*1000);
if (rc != pcmk_rc_ok) {
- out->err(out, "Failed to list installed devices: %s", pcmk_strerror(rc));
+ out->err(out, "Failed to list installed devices: %s", pcmk_rc_str(rc));
}
break;
@@ -550,7 +554,7 @@ main(int argc, char **argv)
case 'L':
rc = pcmk__fence_registered(out, st, target, options.timeout*1000);
if (rc != pcmk_rc_ok) {
- out->err(out, "Failed to list registered devices: %s", pcmk_strerror(rc));
+ out->err(out, "Failed to list registered devices: %s", pcmk_rc_str(rc));
}
break;
@@ -566,7 +570,7 @@ main(int argc, char **argv)
case 's':
rc = pcmk__fence_list_targets(out, st, device, options.timeout*1000);
if (rc != pcmk_rc_ok) {
- out->err(out, "Couldn't list targets: %s", pcmk_strerror(rc));
+ out->err(out, "Couldn't list targets: %s", pcmk_rc_str(rc));
}
break;
@@ -621,15 +625,15 @@ main(int argc, char **argv)
break;
case 'B':
- rc = request_fencing(st, target, "reboot", &error);
+ rc = request_fencing(st, target, PCMK_ACTION_REBOOT, &error);
break;
case 'F':
- rc = request_fencing(st, target, "off", &error);
+ rc = request_fencing(st, target, PCMK_ACTION_OFF, &error);
break;
case 'U':
- rc = request_fencing(st, target, "on", &error);
+ rc = request_fencing(st, target, PCMK_ACTION_ON, &error);
break;
case 'h':