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: output extra error info #97

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Jan 26, 2024

Problem: redfisherpower outputs a very generic "node: error" message for all message errors encountered when trying to do a power operation. This isn't that useful.

Check for several error codes specific to "network" or "http" errors to differentiate them from "error", which is now a catch all for every other potential error.

@chu11 chu11 force-pushed the redfishpower_moreerrors branch 2 times, most recently from 334373c to c7967ed Compare January 27, 2024 16:41
@chu11
Copy link
Member Author

chu11 commented Jan 27, 2024

re-pushed PR, it dawned on me there must be a way to internally get the response code from an http error. So we can get more detailed info now, which can make debugging a lot easier.

redfishpower> stat
phetchy33: unauthorized
redfishpower> auth SECRETSTUFF
redfishpower> stat
phetchy33: on
redfishpower> setstatpath redfish/v1/Systems/foof
redfishpower> stat
phetchy33: not found

Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

Just to be sure we're on the same page, this helps users if they run with pm -T correct? And will set the stage for a future error expect if we go that way?

@chu11
Copy link
Member Author

chu11 commented Jan 27, 2024

Just to be sure we're on the same page, this helps users if they run with pm -T correct? And will set the stage for a future error expect if we go that way?

yup, right now it's for -T so we have a better clue on what the problem is (URL could be wrong, authentication not setup, etc.).

Problem: redfisherpower outputs a very generic "node: error" message
for all message errors encountered when trying to do a power operation.
This isn't that useful.

Check for several error codes specific to common problems to differentiate
them from "error".  "error" is now a catch all for every other potential
error.
@mergify mergify bot merged commit a6dcd66 into chaos:master Jan 27, 2024
7 checks passed
@chu11 chu11 deleted the redfishpower_moreerrors branch January 27, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants