-
Notifications
You must be signed in to change notification settings - Fork 28
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
errors reported by drac5 external stonith plugin #32
base: master
Are you sure you want to change the base?
Conversation
On Tue, Aug 31, 2021 at 03:44:56PM +0000, T.M. Abraham wrote:
The drac5 external plugin outputs empty error lines on every
instance it's called due to the handling in the trap on exit. We
should prevent empty error lines by checking if there's content
to output.
Also, it considers all output from the racadm command it uses as
an error. However, it's output can indicate success, so we shouldn't
report it as an error. Considering it debug is probably more appropriate.
I'd say that either is suboptimal. Is there a meaningful exit
code from racadm? Otherwise, we could try to match the output for
error/warning.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, please provide some information about racadm and its behaviour. Thanks!
The trap generates log entries on exit even if the temp file is empty. This results in errors being reported for every command -- even when help is requested. Log entries should only be generated if there's something to log and should only be logged as errors if an error is returned
This is a more significant change. The trap isn't really needed since all use of the temporary file is limited to sshlogin function. It makes changes to log as an error only when racadm returns an error code (non-zero) and logs as debug otherwise |
if [ x = "x$ipaddr" -o x = "x$userid" ] | ||
then | ||
ha_log.sh err "ipaddr or userid missing; check configuration" | ||
return 1 | ||
fi | ||
@SSH@ -q -x -n $userid@$ipaddr racadm serveraction "$1" >$outf 2>&1 | ||
if [ $? -ne 0 ] | ||
then | ||
ha_log err "$outf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function should return the racadm's exit code, i.e. if it reports an error then the action failed (I'd assume). Note that the following call to cleanup will effectively clear the exit code, so you have to save it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge once the exit code of ssh/racadm gets propagated.
The drac5 external plugin outputs empty error lines on every
instance it's called due to the handling in the trap on exit. We
should prevent empty error lines by checking if there's content
to output.
Also, it considers all output from the racadm command it uses as
an error. However, it's output can indicate success, so we shouldn't
report it as an error. Considering it debug is probably more appropriate.