]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
The unnecessary value "sgids" was deleted
authorhuangpengtao <huangpengtao@huawei.com>
Wed, 5 Aug 2015 15:05:06 +0000 (23:05 +0800)
committerhuangpengtao <huangpengtao@huawei.com>
Wed, 12 Aug 2015 14:53:08 +0000 (22:53 +0800)
The value "sgids" is unnecessary to be used.
Even it is a bit confused to use "sgids",
the code will be easier to understand without it.

Change-Id: I8b881139a71bdc9f3742e7208610eb56081fbbc7

neutron/db/securitygroups_db.py

index 49b4f0913c4f87d86bfff8f6007cd9f5130740fa..e1db0f2e16c95fde14f08d675ababab1954d91ba 100644 (file)
@@ -710,11 +710,8 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
         tenant_id = self._get_tenant_id_for_create(context,
                                                    port['port'])
         default_sg = self._ensure_default_security_group(context, tenant_id)
-        if attributes.is_attr_set(port['port'].get(ext_sg.SECURITYGROUPS)):
-            sgids = port['port'].get(ext_sg.SECURITYGROUPS)
-        else:
-            sgids = [default_sg]
-        port['port'][ext_sg.SECURITYGROUPS] = sgids
+        if not attributes.is_attr_set(port['port'].get(ext_sg.SECURITYGROUPS)):
+            port['port'][ext_sg.SECURITYGROUPS] = [default_sg]
 
     def _check_update_deletes_security_groups(self, port):
         """Return True if port has as a security group and it's value