Merge "Revert "Improve security policy update rules with transactions"" into stable/ussuri
This commit is contained in:
commit
3068159537
|
@ -456,7 +456,10 @@ class TestPolicyTransaction(policy_testcase.TestPolicyApi):
|
||||||
|
|
||||||
dfw_rule1['display_name'] = new_rule_name
|
dfw_rule1['display_name'] = new_rule_name
|
||||||
dfw_rule1['direction'] = new_direction
|
dfw_rule1['direction'] = new_direction
|
||||||
security_policy['rules'] = copy.deepcopy([dfw_rule1, dfw_rule2])
|
child_rules = [{'resource_type': 'ChildRule', 'Rule': dfw_rule1},
|
||||||
|
{'resource_type': 'ChildRule', 'Rule': dfw_rule2,
|
||||||
|
'marked_for_delete': True}]
|
||||||
|
security_policy.update({'children': child_rules})
|
||||||
child_security_policies = [{
|
child_security_policies = [{
|
||||||
'resource_type': 'ChildSecurityPolicy',
|
'resource_type': 'ChildSecurityPolicy',
|
||||||
'SecurityPolicy': security_policy
|
'SecurityPolicy': security_policy
|
||||||
|
|
|
@ -3625,13 +3625,7 @@ class NsxPolicySecurityPolicyBaseApi(NsxPolicyResourceBase):
|
||||||
map_def.set_obj_dict(comm_map)
|
map_def.set_obj_dict(comm_map)
|
||||||
# Update the entire map at the NSX
|
# Update the entire map at the NSX
|
||||||
if transaction:
|
if transaction:
|
||||||
if not ignore_entries:
|
self._create_or_store(map_def, replaced_entries)
|
||||||
# Add the rules under the map and not as ChileRules for
|
|
||||||
# improved performance on the NSX side
|
|
||||||
comm_map['rules'] = [rule.get_obj_dict() for rule in
|
|
||||||
replaced_entries]
|
|
||||||
map_def.set_obj_dict(comm_map)
|
|
||||||
self._create_or_store(map_def)
|
|
||||||
else:
|
else:
|
||||||
body = map_def.get_obj_dict()
|
body = map_def.get_obj_dict()
|
||||||
if not ignore_entries:
|
if not ignore_entries:
|
||||||
|
|
Loading…
Reference in New Issue