diff options
author | Jose Lausuch <jose.lausuch@ericsson.com> | 2017-06-26 10:06:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-26 10:06:30 +0000 |
commit | c8d5216c01c42f0e090f9b441985f8ebc3eca0ed (patch) | |
tree | 04368bda549260970c7b07f12ac09e722b15c1ef /functest/utils/openstack_utils.py | |
parent | a0902eb46edae259f4c0bd0c0209678d989e904b (diff) | |
parent | 971a0c33c0ad2625dc28ab4b81f588ac0a4faaa4 (diff) |
Merge "Change floating ips management from nova to neutron"
Diffstat (limited to 'functest/utils/openstack_utils.py')
-rw-r--r-- | functest/utils/openstack_utils.py | 14 |
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 |