This patch includes updated scripts to modify hardcoded ip addresses
[kvmfornfv.git] / ci / envs / utils.sh
index f582b5a..90c66ba 100755 (executable)
@@ -16,8 +16,14 @@ function getKernelVersion {
    echo ${RPMVERSION}
 }
 
-#Get the IP address from pod.yaml file (example ip : 10.2.117.23)
+#Get the IP address from pod.yaml file (example ip : 10.10.100.22)
 function getHostIP {
-   HOST_IP=`grep 'ip' $WORKSPACE/tests/pod.yaml | awk -F ': ' '{print $NF}' | tail -1`
+   host_dir="/root/workspace/scripts/"
+   container_dir="/opt/scripts/"
+   if [ -d "$container_dir" ];then
+      HOST_IP=`grep 'ip' $container_dir/pod.yaml | awk -F ': ' '{print $NF}' | tail -1`
+   elif [ -d "$host_dir" ];then
+      HOST_IP=`grep 'ip' $host_dir/pod.yaml | awk -F ': ' '{print $NF}' | tail -1`
+   fi
    echo $HOST_IP
 }