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

errors reported by drac5 external stonith plugin #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tabraham
Copy link

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.

@dmuhamedagic
Copy link
Collaborator

dmuhamedagic commented Sep 25, 2021 via email

Copy link
Collaborator

@dmuhamedagic dmuhamedagic left a 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!

lib/plugins/stonith/external/drac5.in Show resolved Hide resolved
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
@tabraham
Copy link
Author

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"
Copy link
Collaborator

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.

Copy link
Collaborator

@dmuhamedagic dmuhamedagic left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants