From 7efb216ca8357533dd040cccc49cb5effec42615 Mon Sep 17 00:00:00 2001 From: tomsou Date: Fri, 3 Feb 2017 13:18:06 +0000 Subject: Implement a get VM IP function in utils to be used within test cases Change-Id: Iaedbfb2fc626eb7d88badee2530593b43c0d1152 Signed-off-by: tomsou --- sdnvpn/lib/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sdnvpn/lib/utils.py') diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py index 8c4aebf..0a77796 100644 --- a/sdnvpn/lib/utils.py +++ b/sdnvpn/lib/utils.py @@ -54,7 +54,7 @@ def create_subnet(neutron_client, name, cidr, net_id): def create_network(neutron_client, net, subnet1, cidr1, router, subnet2=None, cidr2=None): - """Network assoc will not work for networks/subnets created by this function. + """Network assoc won't work for networks/subnets created by this function. It is an ODL limitation due to it handling routers as vpns. See https://bugs.opendaylight.org/show_bug.cgi?id=6962""" @@ -234,6 +234,11 @@ def get_installer_ip(): return str(os.environ['INSTALLER_IP']) +def get_instance_ip(instance): + instance_ip = instance.networks.itervalues().next()[0] + return instance_ip + + def wait_for_instance(instance): logger.info("Waiting for instance %s to get a DHCP lease..." % instance.id) # The sleep this function replaced waited for 80s -- cgit 1.2.3-korg