aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib/utils.py
diff options
context:
space:
mode:
authorJuan Vidal <juan.vidal.allende@ericsson.com>2017-02-21 12:49:32 +0000
committerJuan Vidal <juan.vidal.allende@ericsson.com>2017-04-05 12:26:15 +0000
commit5750895da4e626cc897878acaf6607bd14298802 (patch)
treea5064d41f8772ee0cb43e4a790b2287d48a0d97c /sfc/lib/utils.py
parent8a66eac4bbb898d943d461845e371381425a9cf7 (diff)
Remove get_floating_ips()
get_floating_ips() is non-reusable function, with too much logic into it. By using smaller functions, we can compose the same functionality and build all tests upon a common set of utilities. Using the new functions in functest to retrieve the nova ID for a VNF instance, it is possible to use a generic solution at the problem of getting floating ips deterministcally to the instances Change-Id: Ic7dba908fa6bb343c177fe1a68322d3803ed1707 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
Diffstat (limited to 'sfc/lib/utils.py')
-rw-r--r--sfc/lib/utils.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py
index fb14ff60..e7e93e15 100644
--- a/sfc/lib/utils.py
+++ b/sfc/lib/utils.py
@@ -263,34 +263,6 @@ def assign_floating_ip(nova_client, neutron_client, instance_id):
return floating_ip
-def get_floating_ips(nova_client, neutron_client):
- ips = []
- instances = nova_client.servers.list()
- for instance in instances:
- floatip_dic = os_utils.create_floating_ip(neutron_client)
- floatip = floatip_dic['fip_addr']
- instance.add_floating_ip(floatip)
- logger.info("Instance name and ip %s:%s " % (instance.name, floatip))
- logger.info("Waiting for instance %s:%s to come up" %
- (instance.name, floatip))
- if not ping(floatip):
- logger.info("Instance %s:%s didn't come up" %
- (instance.name, floatip))
- return None
-
- if instance.name == "server":
- logger.info("Server:%s is reachable" % floatip)
- server_ip = floatip
- elif instance.name == "client":
- logger.info("Client:%s is reachable" % floatip)
- client_ip = floatip
- else:
- logger.info("SF:%s is reachable" % floatip)
- ips.append(floatip)
-
- return server_ip, client_ip, ips[1], ips[0]
-
-
def start_http_server(ip):
"""Start http server on a given machine, Can be VM"""
cmd = "\'python -m SimpleHTTPServer 80"