From 61631379ca3a4d93d5c066a82c0b84787fb47384 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Wed, 15 Jun 2016 15:44:44 +0200 Subject: [PATCH] MT#18723 Fix shared IP parsing logic for carrier Carrier mgmt sp2 installation failed because 'sp' was improperly parsed in Carrier case. See /etc/hosts on Carrier: > x.x.x.x sp1 web01a > x.x.x.x sp2 web01b > x.x.x.x sp web01 and on PRO: > x.x.x.x sp1 > x.x.x.x sp2 > x.x.x.x sp As a result variable had multiply values: > root@web01a:~# IP_HA_SHARED=$(awk '/sp/ { print $1 }' /etc/hosts) ; echo $IP_HA_SHARED > 172.30.52.168 172.30.52.169 172.30.52.167 > root@web01a:~# IP_HA_SHARED=$(awk '/sp(\s|$)/ { print $1 }' /etc/hosts) ; echo $IP_HA_SHARED > 172.30.52.167 > root@web01a:~# Change-Id: If05eac1f0bf415db3bf5013b6452b7f9cb0e4947 (cherry picked from commit acbafb43c3db7584612c660518015ff86384d5cb) --- deployment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment.sh b/deployment.sh index b0fde71..072db74 100755 --- a/deployment.sh +++ b/deployment.sh @@ -837,7 +837,7 @@ if "$PRO_EDITION" ; then wget --timeout=30 -O "/tmp/hosts" "${MANAGEMENT_IP}:3000/hostconfig/${TARGET_HOSTNAME}" IP1=$(awk '/sp1/ { print $1 }' /tmp/hosts) || IP1=$DEFAULT_IP1 IP2=$(awk '/sp2/ { print $1 }' /tmp/hosts) || IP2=$DEFAULT_IP2 - IP_HA_SHARED=$(awk '/sp/ { print $1 }' /tmp/hosts) || IP_HA_SHARED=$DEFAULT_IP_HA_SHARED + IP_HA_SHARED=$(awk '/sp(\s|$)/ { print $1 }' /tmp/hosts) || IP_HA_SHARED=$DEFAULT_IP_HA_SHARED if [ -z "$INTERNAL_NETMASK" ]; then wget --timeout=30 -O "/tmp/interfaces" "http://${MANAGEMENT_IP}:3000/nwconfig/${TARGET_HOSTNAME}"