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

dougsland at redhat.com dougsland at redhat.com
Wed Sep 24 19:54:38 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/52/33352/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 531e91a..88a4ee8 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -878,8 +878,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=${value%:*}
+                MGMPORT=${value#*:}
+                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/33352
To unsubscribe, visit http://gerrit.ovirt.org/settings

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



More information about the node-patches mailing list