Make util support more than 10 compute nodes 63/64463/1
authorDaniel Balsiger <Daniel.Balsiger@swisscom.com>
Fri, 2 Nov 2018 22:00:46 +0000 (23:00 +0100)
committerDaniel Balsiger <Daniel.Balsiger@swisscom.com>
Sat, 3 Nov 2018 12:17:45 +0000 (13:17 +0100)
JIRA: APEX-644

The grep command used in the original code matches multiple nodes
when deploying 10+ compute nodes. This makes opnfv-util fail to
connect to those nodes. Proposed fix is to grep for "$node "
instead.

Change-Id: I952664f6f3cab3a98681684cd354513bb3c0ab12
Signed-off-by: Daniel Balsiger <Daniel.Balsiger@swisscom.com>
ci/util.sh

index a9df021..5172ae1 100755 (executable)
@@ -48,7 +48,7 @@ controller<number> or compute<number>"
   node_output=$(undercloud_connect "stack" "source stackrc; nova list")
   node=$(echo "$1" | sed -E 's/([a-zA-Z]+)([0-9]+)/\1-\2/')
 
-  node_ip=$(echo "$node_output" | grep "$node" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")
+  node_ip=$(echo "$node_output" | grep "$node " | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")
 
   if [ "$node_ip" == "" ]; then
     echo -e "Unable to find IP for ${node} in \n${node_output}"