From 76fa308ca9c45405657432c2ade83009dcbc9aa1 Mon Sep 17 00:00:00 2001 From: zhouhenglc Date: Wed, 29 Apr 2020 17:11:37 +0800 Subject: [PATCH] ensure default security group exists when filter by project_id now filter security groups by tenant_id, will auto ensure default security group, but project_id not. tenant_id is deprecated, we are used to filtering by project_id. Closes-bug: #1875849 Change-Id: I3f1a2698768e2d66811bb290a892a1b089dff4ed --- neutron/db/securitygroups_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/securitygroups_db.py b/neutron/db/securitygroups_db.py index 61c47c3ca6a..ca9fd44f84c 100644 --- a/neutron/db/securitygroups_db.py +++ b/neutron/db/securitygroups_db.py @@ -165,7 +165,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase, # GETS. TODO(arosen) context handling can probably be improved here. filters = filters or {} if not default_sg and context.tenant_id: - tenant_id = filters.get('tenant_id') + tenant_id = filters.get('project_id') or filters.get('tenant_id') if tenant_id: tenant_id = tenant_id[0] else: