Hi!

As suggested I'm considering to replace all "ocf_log err ..." preceeding an 
error exit code with "ocf_exit_reason ..." in my OCF RA.
However I have a question: Is it OK to call ocf_exit_reason more than once 
before actually exiting? I assume the last message being used will be the one 
displayed as reason then.
My RA code checks multiple parameters, logging each error (not stopping at the 
first error if possible), like this:

...
    if [ ! -x $isredir_bin ]; then
        ocf_log err "$me: missing $isredir_bin"
        result=$OCF_ERR_INSTALLED
    fi
    if [ "X${tag//[^-A-Za-z0-9._]/}" != "X${tag}" ]; then
        ocf_log err "$me: invalid value $tag for \"tag\""
        result=$OCF_ERR_ARGS
    fi
    if [ "X${backlog//[^0-9]/}" != "X${backlog}" ]; then
        ocf_log err "$me: invalid value $backlog for \"backlog\""
        result=$OCF_ERR_ARGS
    fi
    if [ -z "$dest_tsap" ]; then
        ocf_log err "$me: missing value for \"dest\""
        result=$OCF_ERR_ARGS
    elif [ "X${dest_tsap//[^-A-Za-z0-9._\\/]/}" != "X${dest_tsap}" ]; then
        ocf_log err "$me: invalid value $dest_tsap for \"dest\""
        result=$OCF_ERR_ARGS
    fi
...

Regards,
Ulrich


_______________________________________________
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/

Reply via email to