From: huangpengtao Date: Wed, 5 Aug 2015 15:05:06 +0000 (+0800) Subject: The unnecessary value "sgids" was deleted X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cf7086701b02b08c30c5a20b6b3473f6dc79f3fe;p=openstack-build%2Fneutron-build.git The unnecessary value "sgids" was deleted 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 --- diff --git a/neutron/db/securitygroups_db.py b/neutron/db/securitygroups_db.py index 49b4f0913..e1db0f2e1 100644 --- a/neutron/db/securitygroups_db.py +++ b/neutron/db/securitygroups_db.py @@ -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