Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redfishpower: adjust verbosity output #151

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion man/redfishpower.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Set Redfish postdata for performing power on. Typically is {"ResetType":"On"}
Set Redfish postdata for performing power off. Typically is {"ResetType":"ForceOff"}
.TP
.I "-v, --verbose"
Increase output verbosity.
Increase output verbosity. Can be specified multiple times.
.SH INTERACTIVE COMMANDS
The following commands are accepted at the redfishpower> prompt:
.TP
Expand Down
10 changes: 7 additions & 3 deletions src/redfishpower/redfishpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void powermsg_init_curl(struct powermsg *pm)
Curl_easy_setopt((pm->eh, CURLOPT_SSL_VERIFYPEER, 0L));
Curl_easy_setopt((pm->eh, CURLOPT_SSL_VERIFYHOST, 0L));

if (verbose)
if (verbose > 2)
Curl_easy_setopt((pm->eh, CURLOPT_VERBOSE, 1L));

if (header) {
Expand Down Expand Up @@ -394,8 +394,12 @@ static void parse_onoff_response(struct powermsg *pm, const char **strp)
(*strp) = STATUS_ON;
else if (strcasecmp(str, "Off") == 0)
(*strp) = STATUS_OFF;
else
else {
(*strp) = STATUS_UNKNOWN;
if (verbose)
printf("%s: unknown status - %s\n",
pm->hostname,str);
}
}
}
json_decref(o);
Expand Down Expand Up @@ -1037,7 +1041,7 @@ int main(int argc, char *argv[])
err_exit(true, "hostlist_push error on %s", optarg);
break;
case 'v': /* --verbose */
verbose = 1;
verbose++;
break;
default:
usage();
Expand Down
Loading