Noam Slomianko has uploaded a new change for review.

Change subject: tools: engine-notifier accept special chars
......................................................................

tools: engine-notifier accept special chars

Due to the way configuration was loaded in the bash script
special characters would create some unwanted behaviors.

Now the configuration file is read and the variables are added
using "declare" statement

Change-Id: I5e6419a225bd02edaf1db38a2025dee74761ddf2
Bug-Url: https://bugzilla.redhat.com/883301
Signed-off-by: Noam Slomianko <[email protected]>
---
M 
backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/04/10704/1

diff --git 
a/backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh
 
b/backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh
index 60c970a..e718a6b 100755
--- 
a/backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh
+++ 
b/backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh
@@ -40,8 +40,17 @@
     CONF_FILE="${ENGINE_ETC}/notifier/notifier.conf"
 fi
 
-# Import configurations
-. $CONF_FILE
+# Import configurations safely
+for line in `cat $CONF_FILE`:
+    do
+    if [[ $line == \#* ]] || [[ ${line}x == "x" ]] ;  then
+        #if comment or empty, skip
+        continue
+    else
+        declare "$line"
+    fi
+done
+
 
 # Do basic checking of properties in configuration file to ensure
 # a) properties are defined


--
To view, visit http://gerrit.ovirt.org/10704
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e6419a225bd02edaf1db38a2025dee74761ddf2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Noam Slomianko <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to