diff options
Diffstat (limited to 'tools/stonith_admin.c')
-rw-r--r-- | tools/stonith_admin.c | 18 |
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': |