From e99db084f445d896fdfe53c90448a3eb80d4f304 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Mon, 3 Sep 2018 16:40:57 +0200 Subject: [PATCH] aci_interface_policy_leaf_policy_group: Fix filtering by lagT (#45088) --- lib/ansible/module_utils/network/aci/aci.py | 3 +++ .../aci_interface_policy_leaf_policy_group/tasks/main.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py index 25fea20953..4e8d9df3ad 100644 --- a/lib/ansible/module_utils/network/aci/aci.py +++ b/lib/ansible/module_utils/network/aci/aci.py @@ -461,6 +461,7 @@ class ACIModule(object): elif mo is None: # Query for all objects of the module's class (filter by properties) self.path = 'api/class/{0}.json'.format(obj_class) + self.update_qs({'query-target-filter': self.build_filter(obj_class, obj_filter)}) else: # Query for a specific object in the module's class self.path = 'api/mo/uni/{0}.json'.format(obj_rn) @@ -485,6 +486,7 @@ class ACIModule(object): elif parent_obj is None and mo is None: # Query for all objects of the module's class self.path = 'api/class/{0}.json'.format(obj_class) + self.update_qs({'query-target-filter': self.build_filter(obj_class, obj_filter)}) elif parent_obj is None: # mo is known # Query for all objects of the module's class that match the provided ID value self.path = 'api/class/{0}.json'.format(obj_class) @@ -521,6 +523,7 @@ class ACIModule(object): elif root_obj is None and parent_obj is None and mo is None: # Query for all objects of the module's class self.path = 'api/class/{0}.json'.format(obj_class) + self.update_qs({'query-target-filter': self.build_filter(obj_class, obj_filter)}) elif root_obj is None and parent_obj is None: # mo is known # Query for all objects of the module's class matching the provided ID value of the object self.path = 'api/class/{0}.json'.format(obj_class) diff --git a/test/integration/targets/aci_interface_policy_leaf_policy_group/tasks/main.yml b/test/integration/targets/aci_interface_policy_leaf_policy_group/tasks/main.yml index e38a227f49..5ed87fa36a 100644 --- a/test/integration/targets/aci_interface_policy_leaf_policy_group/tasks/main.yml +++ b/test/integration/targets/aci_interface_policy_leaf_policy_group/tasks/main.yml @@ -260,6 +260,7 @@ that: - binding_query_node_all is not changed - binding_query_node_all.current | length >= 1 + - binding_query_node_all.current | selectattr("infraAccBndlGrp.attributes.lagT", "equalto", "link") | list == [] - '"/api/class/infraAccBndlGrp.json" in binding_query_node_all.url' - name: Remove interface policy leaf policy group (VPC) - check mode