Add safty checks when getting port provider securtiy groups
If for some reason during update-port the original port does not have the provider security groups attribute, it may fail. Change-Id: Id6af4c714fd3dfd5fe8958b1f061d313c14d0f46
This commit is contained in:
parent
b9cd2f717a
commit
9767d9e7c9
@ -307,7 +307,7 @@ class ExtendedSecurityGroupPropertiesMixin(object):
|
||||
n_constants.ATTR_NOT_SPECIFIED)
|
||||
provider_sg_changed = (
|
||||
provider_sg_specified and not helpers.compare_elements(
|
||||
original_port[provider_sg.PROVIDER_SECURITYGROUPS],
|
||||
original_port.get(provider_sg.PROVIDER_SECURITYGROUPS, []),
|
||||
p[provider_sg.PROVIDER_SECURITYGROUPS]))
|
||||
sg_changed = (
|
||||
set(original_port[ext_sg.SECURITYGROUPS]) !=
|
||||
@ -322,7 +322,7 @@ class ExtendedSecurityGroupPropertiesMixin(object):
|
||||
self._get_provider_security_groups_on_port(context, port))
|
||||
else:
|
||||
updated_port[provider_sg.PROVIDER_SECURITYGROUPS] = (
|
||||
original_port[provider_sg.PROVIDER_SECURITYGROUPS])
|
||||
original_port.get(provider_sg.PROVIDER_SECURITYGROUPS, []))
|
||||
|
||||
if provider_sg_changed or sg_changed:
|
||||
if not sg_changed:
|
||||
|
Loading…
Reference in New Issue
Block a user