From a867833d0943b36f431b869c630959aa23abaf0f Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Thu, 19 Oct 2017 12:39:19 -0700 Subject: Script to get floating IP for a server name Change-Id: I6608c075c6c1adfa1a088f5da70619ebd773ffa5 Issue-ID: INT-278 Signed-off-by: Gary Wu --- test/ete/scripts/get-floating-ip.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/ete/scripts/get-floating-ip.sh (limited to 'test') diff --git a/test/ete/scripts/get-floating-ip.sh b/test/ete/scripts/get-floating-ip.sh new file mode 100644 index 000000000..55854e73f --- /dev/null +++ b/test/ete/scripts/get-floating-ip.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# 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 -- cgit 1.2.3-korg