From 529c74346235eccc0be51ae58f8c8a5421a51964 Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Wed, 5 Aug 2015 13:43:04 +0000 Subject: [PATCH] Avoid trace when listing SG with non-existing tenant_id Currently when listing SGs with tenant_id that doesn't exist we get a stacktrace. The behaviour of neutron/ML2 is to create a default SG for the tenant_id given even if the tenant doesn't exist. For contrail is seems to be better to return an empty answer is this case. This patch remove the traceback and return nothing when listing SGs with a non existing tenant id. Change-Id: I5521c7630036ed28f6c87ed542204800086e50bc Partial-Bug: #1480901 --- src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py index 8ad6385072b..09be4a1ade6 100644 --- a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py +++ b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py @@ -484,8 +484,8 @@ def _security_group_list_project(self, project_id): project_uuid = str(uuid.UUID(project_id)) # Trigger a project read to ensure project sync project_obj = self._project_read(proj_id=project_uuid) - except Exception: - raise + except vnc_exc.NoIdError: + return [] else: project_uuid = None