From 826428dc8aeef124c2251624ae34fdc003e69ca4 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 9 Jun 2015 19:00:40 +0900 Subject: [PATCH] Add a comment on _check_update_has_security_groups Despite of its name, _check_update_has_security_groups can handle create requests as well. There are plugins actually using it for create. eg. ml2, vmware Change-Id: I3c26ad0ac00b12ce24096bfc27606797af2d9098 --- neutron/db/securitygroups_db.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neutron/db/securitygroups_db.py b/neutron/db/securitygroups_db.py index 1fec3f223..3caca9bbc 100644 --- a/neutron/db/securitygroups_db.py +++ b/neutron/db/securitygroups_db.py @@ -709,8 +709,9 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase): return False def _check_update_has_security_groups(self, port): - """Return True if port has as a security group and False if the - security_group field is is_attr_set or []. + """Return True if port has security_groups attribute set and + its not empty, or False otherwise. + This method is called both for port create and port update. """ if (ext_sg.SECURITYGROUPS in port['port'] and (attributes.is_attr_set(port['port'][ext_sg.SECURITYGROUPS]) and -- 2.45.2