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
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