aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/openstack_utils.py
diff options
context:
space:
mode:
authorShobhi Jain <shobhi.jain@intel.com>2018-02-19 16:50:51 +0000
committerShobhi Jain <shobhi.jain@intel.com>2018-03-12 10:58:47 +0000
commit5d5c7649d60901042e26d7d8400dc2d1ca2fb586 (patch)
treed9c48f9b44f28f5eb4c51906b1920a7c8e04cd5c /yardstick/common/openstack_utils.py
parent9f26e65c62fd5a4a1fbf9048e3bfe857b18729c9 (diff)
Replace neutron router deletion with shade.
Function delete_neutron_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I5b557b640396f343b85b5f5eff415384decc083c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
Diffstat (limited to 'yardstick/common/openstack_utils.py')
-rw-r--r--yardstick/common/openstack_utils.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/yardstick/common/openstack_utils.py b/yardstick/common/openstack_utils.py
index 0421346e6..84bfbbbb1 100644
--- a/yardstick/common/openstack_utils.py
+++ b/yardstick/common/openstack_utils.py
@@ -528,13 +528,12 @@ def create_neutron_router(neutron_client, json_body): # pragma: no cover
raise Exception("operation error")
-def delete_neutron_router(neutron_client, router_id): # pragma: no cover
+def delete_neutron_router(shade_client, router_id):
try:
- neutron_client.delete_router(router=router_id)
- return True
- except Exception: # pylint: disable=broad-except
- log.error("Error [delete_neutron_router(neutron_client, '%s')]",
- router_id)
+ return shade_client.delete_router(router_id)
+ except exc.OpenStackCloudException as o_exc:
+ log.error("Error [delete_neutron_router(shade_client, '%s')]. "
+ "Exception message: %s", router_id, o_exc.orig_message)
return False