]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add a comment on _check_update_has_security_groups
authorYAMAMOTO Takashi <yamamoto@midokura.com>
Tue, 9 Jun 2015 10:00:40 +0000 (19:00 +0900)
committerYAMAMOTO Takashi <yamamoto@midokura.com>
Tue, 9 Jun 2015 10:27:20 +0000 (19:27 +0900)
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

index 1fec3f2239bb4c4b711c4f711f14ddcc053ce8a8..3caca9bbc918f60cfb699e17c4946238cdbe1f1a 100644 (file)
@@ -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