Juan Hernandez has uploaded a new change for review. Change subject: tools: Avoid errors when reading notifier.conf ......................................................................
tools: Avoid errors when reading notifier.conf The current mechanism that we use to read the notifier.conf file in the notifier script generates the following error messages: engine-notifier.sh: line 68: declare: `#': not a valid identifier To avoid that the condition to ignore empty lines and comment lines has been replaced with a sed command that removes them before they are processed by the notifier script. Change-Id: If2670db513f6f9814feb8fe2786219f12530ea96 Bug-Url: https://bugzilla.redhat.com/911216 Signed-off-by: Juan Hernandez <[email protected]> --- M backend/manager/tools/src/main/shell/engine-notifier.sh 1 file changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/12528/1 diff --git a/backend/manager/tools/src/main/shell/engine-notifier.sh b/backend/manager/tools/src/main/shell/engine-notifier.sh index a0febaa..3367b9a 100755 --- a/backend/manager/tools/src/main/shell/engine-notifier.sh +++ b/backend/manager/tools/src/main/shell/engine-notifier.sh @@ -69,14 +69,9 @@ # Import configurations safely old_IFS=$IFS IFS=$'\n' -for line in `cat $CONF_FILE`: - do - if [[ $line == "\#*" ]] || [[ ${line}x == "x" ]] ; then - #if comment or empty, skip - continue - else - declare "$line" - fi +for line in `sed -e 's/[ \t]*#.*//' -e '/^[ \t]*$/d' $CONF_FILE`: +do + declare "$line" done IFS=$old_IFS -- To view, visit http://gerrit.ovirt.org/12528 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2670db513f6f9814feb8fe2786219f12530ea96 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
