aboutsummaryrefslogtreecommitdiffstats
path: root/test/ete/scripts/get-floating-ip.sh
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-01-05 14:04:51 -0800
committerGary Wu <gary.i.wu@huawei.com>2018-01-05 14:07:45 -0800
commitab1fd5361b603ed4a6db7b9c6495a819b052d21a (patch)
tree10e22fda554c304fa32ee9256acabf763592a920 /test/ete/scripts/get-floating-ip.sh
parentf82334365c86fcee00310456f17b40d6af782f23 (diff)
Refactor script to retrieve instance floating IP
Change-Id: Iacfe44feb72456a78372422937645f8ecc92888b Issue-ID: INT-278 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'test/ete/scripts/get-floating-ip.sh')
-rwxr-xr-xtest/ete/scripts/get-floating-ip.sh7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/ete/scripts/get-floating-ip.sh b/test/ete/scripts/get-floating-ip.sh
index 55854e73f..196f6d244 100755
--- a/test/ete/scripts/get-floating-ip.sh
+++ b/test/ete/scripts/get-floating-ip.sh
@@ -1,6 +1,3 @@
-#!/bin/sh
+#!/bin/bash
# Get floating IP assigned to a server name
-
-PORT_ID=$(openstack server show -f json $1 | python -c 'import sys, json; print json.load(sys.stdin)["wrs-if:nics"][0]["nic1"]["port_id"]')
-FLOATING_IP=$(openstack floating ip list -f json --port $PORT_ID | python -c 'import sys, json; print json.load(sys.stdin)[0]["Floating IP Address"]')
-echo $FLOATING_IP
+openstack server show -c addresses -f json $1 | jq -r '.addresses' | tr -d ' ' | cut -d ',' -f 2