From: YAMAMOTO Takashi Date: Tue, 9 Jun 2015 10:00:40 +0000 (+0900) Subject: Add a comment on _check_update_has_security_groups X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=826428dc8aeef124c2251624ae34fdc003e69ca4;p=openstack-build%2Fneutron-build.git 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 --- 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