Fixed delete_tenant at nwa error response

Add warning log when nwa response is not 200 ok.

Change-Id: Id239125dcabd73451995f97a0f833e90d7474fea
Closes-Bug: #1548810
This commit is contained in:
Shinji YANAGIDA 2016-04-12 07:15:12 +09:00
parent 65b2e1ae8e
commit 653f3ab06e
1 changed files with 5 additions and 4 deletions

View File

@ -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