Juan Hernandez has uploaded a new change for review.

Change subject: BZ#856167 - Parse correctly the management_server parameter
......................................................................

BZ#856167 - Parse correctly the management_server parameter

When doing automatic installations we parse the management_server
parameter to find the engine address and port number, but we don't
parse it correctly if the port number is missing, in this case we end up
using the address as both address and port number. This patch fixes that
so when the port number is missing the default 443 will be used.

Change-Id: I74d658902d3421c0ac554c5c2634ddc8c6a28b21
Signed-off-by: Juan Hernandez <[email protected]>
---
M vdsm_reg/vdsm-config
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/8022/1

diff --git a/vdsm_reg/vdsm-config b/vdsm_reg/vdsm-config
index 1cb4c2c..9bcdbbb 100755
--- a/vdsm_reg/vdsm-config
+++ b/vdsm_reg/vdsm-config
@@ -72,8 +72,13 @@
                echo "checkpoint 2 ::management_server: $managment_server" >> 
$LOG 2>&1
 
                if [ ! -z "$managment_server" ]; then
-                       vdc_managment_server=${managment_server%:*}
-                       vdc_managment_port=${managment_server#*:}
+                       if [[ "$managment_server" == *:* ]]; then
+                               vdc_managment_server=${managment_server%:*}
+                               vdc_managment_port=${managment_server#*:}
+                       else
+                               vdc_managment_server=${managment_server}
+                               vdc_managment_port=443
+                       fi
                        strRHEVMAddress=$vdc_managment_server
                        tmp_vdsm_reg_conf=`mktemp`
                        cat /etc/vdsm-reg/vdsm-reg.conf > "$tmp_vdsm_reg_conf"


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74d658902d3421c0ac554c5c2634ddc8c6a28b21
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to