[node-patches] Change in ovirt-node[master]: init: Split management_server if user used "addr:port"

dougsland at redhat.com dougsland at redhat.com
Thu Aug 14 03:14:29 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: init: Split management_server if user used "addr:port"
......................................................................

init: Split management_server if user used "addr:port"

If user specify in the autoinstall management_server="addr:port"
it will set the variable OVIRT_MANAGEMENT_SERVER="addr:port" in
/etc/default/ovirt which is incorrect. We should split it
and set OVIRT_MANAGEMENT_SERVER="addr" and OVIRT_MANAGEMENT_PORT="port".
This patch adds a validation into the boot schema to split the
management_server data correctly into /etc/default/ovirt schema.

Change-Id: I8b0d4055a8fd66c761a977d160422befc42019f9
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1065401
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M scripts/ovirt-init-functions.sh.in
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/83/31483/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 30b7576..d31064e 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -887,8 +887,17 @@
         value=$(ptr $p)
         if [ -n "$value" -o $p = 'init' -o $p = 'upgrade' -o $p = 'install' ]; then
             log "Updating OVIRT_$PARAM to '$value'"
-            echo "set /files$OVIRT_DEFAULTS/OVIRT_$PARAM '\"$value\"'" \
-                >> $tmpaug
+            if [[ ${PARAM} == "MANAGEMENT_SERVER" && ${value} == *:* ]]; then
+                MGMSERVER=`echo $value | cut -d \: -f 1`
+                MGMPORT=`echo $value | cut -d \: -f 2`
+                echo "set /files$OVIRT_DEFAULTS/OVIRT_MANAGEMENT_SERVER '\"${MGMSERVER}\"'" \
+                    >> $tmpaug
+                echo "set /files$OVIRT_DEFAULTS/OVIRT_MANAGEMENT_PORT '\"${MGMPORT}\"'" \
+                    >> $tmpaug
+            else
+                echo "set /files$OVIRT_DEFAULTS/OVIRT_$PARAM '\"$value\"'" \
+                    >> $tmpaug
+            fi
         fi
     done
     # block accidental bootif changes on upgrades


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b0d4055a8fd66c761a977d160422befc42019f9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>



More information about the node-patches mailing list