NSX will reject expression list of a group if defined like follows:
---
"expression":
[{"expressions": [
{"member_type": "LogicalPort", "operator": "EQUALS", "value": "tag1|x"},
{"conjunction_operator": "AND", "resource_type": "ConjunctionOperator"},
{member_type": "LogicalPort", "operator": "EQUALS", "value": "tag2|y"}
], "resource_type": "NestedExpression"},
{"conjunction_operator": "OR", "resource_type": "ConjunctionOperator"},
{"expressions": [
{"member_type": "LogicalPort", "operator": "EQUALS", "value": "tag1|x"},
{"conjunction_operator": "AND", "resource_type": "ConjunctionOperator"},
{member_type": "LogicalPort", "operator": "EQUALS", "value": "tag2|y"}
], "resource_type": "NestedExpression"},
"resource_type": "NestedExpression"}
]
---
Because the two NestedExpressions are identical. If patch a group with the
spec above, 'Duplicate expressions specified' error will be returned. This
patch ensures that before a union condition is built, all conditions are
first dedupped.
Change-Id: I0d2d93f6ade992582ad931b3622354e5b9398a1d
Signed-off-by: Yang Ding <dingyang@vmware.com>