Remove attribute not specified before checking duplicate sg rules

The security-group extension secgroup-local-ip-prefix allows the user to
specify a new rule attribute in the request, before passing the request
to Neutron, we must remove ATTR_NOT_SPECIFIED if the attribute was not
specified and replace it with None.
The bug is due to change: I2bd6b3381c715c1286dfa10bf3b143c73fecf49d

Closes-Bug: #1563790
Change-Id: Ie921f9e41fc6b45d521bf8f9f041c773cdd19c31
changes/99/299299/1
Roey Chen 7 years ago
parent 82660993e7
commit c946784134
  1. 5
      vmware_nsx/db/extended_security_group_rule.py

@ -56,8 +56,13 @@ class ExtendedSecurityGroupRuleMixin(object):
def _check_local_ip_prefix(self, context, rule):
rule_specify_local_ip_prefix = attr.is_attr_set(
rule.get(ext_local_ip.LOCAL_IP_PREFIX))
if rule_specify_local_ip_prefix and rule['direction'] != 'ingress':
raise NotIngressRule()
if not rule_specify_local_ip_prefix:
# remove ATTR_NOT_SPECIFIED
rule[ext_local_ip.LOCAL_IP_PREFIX] = None
return rule_specify_local_ip_prefix
def _process_security_group_rule_properties(self, context,

Loading…
Cancel
Save