aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/openstack_utils.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2017-06-23 11:32:56 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2017-06-26 09:47:12 +0200
commit971a0c33c0ad2625dc28ab4b81f588ac0a4faaa4 (patch)
treeaa0df26eed9482eaf76dfd24010b8d4935447f33 /functest/utils/openstack_utils.py
parentb04150dda0678772a6a42da8d7878deb4ddcd551 (diff)
Change floating ips management from nova to neutron
Nova does not longer support floating ip creation/deletion. This patch moves that logic to neutron client. Change-Id: I2c4146149fe5be534d9c50d78d831b5af1957ad7 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'functest/utils/openstack_utils.py')
-rw-r--r--functest/utils/openstack_utils.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py
index a8966264..354a562e 100644
--- a/functest/utils/openstack_utils.py
+++ b/functest/utils/openstack_utils.py
@@ -422,12 +422,12 @@ def get_or_create_flavor(flavor_name, ram, disk, vcpus, public=True):
return flavor_exists, flavor_id
-def get_floating_ips(nova_client):
+def get_floating_ips(neutron_client):
try:
- floating_ips = nova_client.floating_ips.list()
- return floating_ips
+ floating_ips = neutron_client.list_floatingips()
+ return floating_ips['floatingips']
except Exception as e:
- logger.error("Error [get_floating_ips(nova_client)]: %s" % e)
+ logger.error("Error [get_floating_ips(neutron_client)]: %s" % e)
return None
@@ -590,12 +590,12 @@ def delete_instance(nova_client, instance_id):
return False
-def delete_floating_ip(nova_client, floatingip_id):
+def delete_floating_ip(neutron_client, floatingip_id):
try:
- nova_client.floating_ips.delete(floatingip_id)
+ neutron_client.delete_floatingip(floatingip_id)
return True
except Exception as e:
- logger.error("Error [delete_floating_ip(nova_client, '%s')]: %s"
+ logger.error("Error [delete_floating_ip(neutron_client, '%s')]: %s"
% (floatingip_id, e))
return False