HomeClusterLabs Projects

Low: ocf-shellfuncs: Avoid printing empty INFO messages (bsc#1053621)

Description

Low: ocf-shellfuncs: Avoid printing empty INFO messages (bsc#1053621)

When monitoring a pgsql database using ocf:heartbeat:pgsql,
each monitor produces two empty INFO messages in the ha logfile.

This is caused by a broken ocf_run in
/usr/lib/ocf/lib/heartbeat/ocf-shellfuncs which runs:

output=`echo "$output" | tr -s ' \t\r\n' ' '`

This causes output always being ' ', even if the called
command has no output.

The following two tests for ! -z "$output" are broken
and causes these empty messages to appear.

Proposed fix is to only run the tr command if $output
actually has content.

Details

Provenance
Kristoffer Grönlund <krig@koru.se>Authored on Aug 28 2017, 3:23 AM
Parents
rRb4582bdb679e: Merge pull request #1018 from vaLski/virsh_shutdown_mode
Branches
Unknown
Tags
Unknown

Event Timeline