aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common
diff options
context:
space:
mode:
authorShobhi Jain <shobhi.jain@intel.com>2018-02-27 13:19:00 +0000
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-03-27 15:17:08 +0000
commitc68bf22cc439eb72b6b237258f126776d7e58fb6 (patch)
tree55df6692a0c0679671c6234901c5bd52da78f815 /yardstick/common
parent221da2200131f617d36f3143e730f9dcfab530d0 (diff)
Replace neutron floating ip deletion with shade.
Function delete_floating_ip now uses shade client. JIRA: YARDSTICK-890 Change-Id: I960630926b664266afbe7be00bb1352243b41be0 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
Diffstat (limited to 'yardstick/common')
-rw-r--r--yardstick/common/exceptions.py4
-rw-r--r--yardstick/common/openstack_utils.py12
2 files changed, 10 insertions, 6 deletions
diff --git a/yardstick/common/exceptions.py b/yardstick/common/exceptions.py
index 402b5b99c..43d1eb598 100644
--- a/yardstick/common/exceptions.py
+++ b/yardstick/common/exceptions.py
@@ -132,3 +132,7 @@ class ScenarioRemoveRouterIntError(YardstickException):
class ScenarioCreateFloatingIPError(YardstickException):
message = 'Create Neutron Floating IP Scenario failed'
+
+
+class ScenarioDeleteFloatingIPError(YardstickException):
+ message = 'Delete Neutron Floating IP Scenario failed'
diff --git a/yardstick/common/openstack_utils.py b/yardstick/common/openstack_utils.py
index 591a1b313..a6b53a607 100644
--- a/yardstick/common/openstack_utils.py
+++ b/yardstick/common/openstack_utils.py
@@ -615,13 +615,13 @@ def create_floating_ip(shade_client, network_name_or_id=None, server=None,
"Exception message: %s", o_exc.orig_message)
-def delete_floating_ip(nova_client, floatingip_id): # pragma: no cover
+def delete_floating_ip(shade_client, floating_ip_id, retry=1):
try:
- nova_client.floating_ips.delete(floatingip_id)
- return True
- except Exception: # pylint: disable=broad-except
- log.error("Error [delete_floating_ip(nova_client, '%s')]",
- floatingip_id)
+ return shade_client.delete_floating_ip(floating_ip_id=floating_ip_id,
+ retry=retry)
+ except exc.OpenStackCloudException as o_exc:
+ log.error("Error [delete_floating_ip(shade_client,'%s')]. "
+ "Exception message: %s", floating_ip_id, o_exc.orig_message)
return False