Skip to content

Commit

Permalink
Merge pull request #151 from chu11/redfishpower_verbosity
Browse files Browse the repository at this point in the history
redfishpower: adjust verbosity output
  • Loading branch information
mergify[bot] authored Feb 29, 2024
2 parents 560c926 + 67797dc commit 3494465
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 3494465

Please sign in to comment.