From 653f3ab06e60a2cb588f8b9a05902dfdacb12c3c Mon Sep 17 00:00:00 2001 From: Shinji YANAGIDA Date: Tue, 12 Apr 2016 07:15:12 +0900 Subject: [PATCH] Fixed delete_tenant at nwa error response Add warning log when nwa response is not 200 ok. Change-Id: Id239125dcabd73451995f97a0f833e90d7474fea Closes-Bug: #1548810 --- networking_nec/nwa/agent/proxy_tenant.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/networking_nec/nwa/agent/proxy_tenant.py b/networking_nec/nwa/agent/proxy_tenant.py index 85dbf59..a916107 100644 --- a/networking_nec/nwa/agent/proxy_tenant.py +++ b/networking_nec/nwa/agent/proxy_tenant.py @@ -16,6 +16,7 @@ from neutron.common import topics from oslo_log import log as logging from oslo_serialization import jsonutils +from networking_nec._i18n import _LW from networking_nec.common import utils from networking_nec.nwa.common import exceptions as nwa_exc from networking_nec.nwa.l2.rpc import tenant_binding_api @@ -73,10 +74,10 @@ class AgentProxyTenant(object): @return: result(succeed = (True, dict(empty) other = False, None) """ nwa_tenant_id = kwargs.get('nwa_tenant_id') - __rcode, body = self.client.tenant.delete_tenant(nwa_tenant_id) - # NOTE(amotoki): At now this method never fails. - # If we need to handle a failure, raise nwa_exc.AgentProxyException. - # and catch the exception in a caller. + rcode, body = self.client.tenant.delete_tenant(nwa_tenant_id) + if rcode != 200: + LOG.warning(_LW('unexpected status code %s in delete_tenant'), + rcode) return body @utils.log_method_return_value