From 308affa031d71c29ecbd5273bb83e6bd476faf57 Mon Sep 17 00:00:00 2001 From: hemanthKa677 Date: Tue, 13 Sep 2022 15:50:41 +0530 Subject: [PATCH 1/2] Added object ref for template feature --- plugins/module_utils/api.py | 8 ++++++++ plugins/modules/nios_network.py | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index c1e00974..2f0f48cc 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -665,6 +665,14 @@ def get_object_ref(self, module, ib_obj_type, obj_filter, ib_spec): if temp: # reinstate 'create_token' key ib_spec['create_token'] = temp + elif (ib_obj_type in (NIOS_IPV4_NETWORK, NIOS_IPV6_NETWORK, NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER)): + # del key 'template' as nios_network get_object fails with the key present + temp = ib_spec['template'] + del ib_spec['template'] + ib_obj = self.get_object(ib_obj_type, obj_filter.copy(), return_fields=list(ib_spec.keys())) + if temp: + # reinstate 'template' key + ib_spec['template'] = temp else: ib_obj = self.get_object(ib_obj_type, obj_filter.copy(), return_fields=list(ib_spec.keys())) return ib_obj, update, new_name diff --git a/plugins/modules/nios_network.py b/plugins/modules/nios_network.py index 62a9f447..e53782dd 100644 --- a/plugins/modules/nios_network.py +++ b/plugins/modules/nios_network.py @@ -238,7 +238,6 @@ def check_ip_addr_type(obj_filter, ib_spec): check_ip = ip.split('/') del ib_spec['container'] # removing the container key from post arguments del ib_spec['options'] # removing option argument as for network container it's not supported - del ib_spec['template'] # removing template argument as it is not searchable argument if validate_ip_address(check_ip[0]): return NIOS_IPV4_NETWORK_CONTAINER, ib_spec elif validate_ip_v6_address(check_ip[0]): @@ -246,7 +245,6 @@ def check_ip_addr_type(obj_filter, ib_spec): else: check_ip = ip.split('/') del ib_spec['container'] # removing the container key from post arguments - del ib_spec['template'] # removing template argument as it is not searchable argument if validate_ip_address(check_ip[0]): return NIOS_IPV4_NETWORK, ib_spec elif validate_ip_v6_address(check_ip[0]): From 93cd5f36842c9f34774393748a357fdbdb42ae4b Mon Sep 17 00:00:00 2001 From: hemanthKa677 Date: Wed, 14 Sep 2022 09:52:40 +0530 Subject: [PATCH 2/2] version of coverage is modified --- .github/workflows/ansible-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 7d928b7b..96f1488e 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -91,7 +91,7 @@ jobs: - name: Generate coverage report run: | - if [ "${{ matrix.ansible-version }}" == "devel" ]; then pip install coverage==6.4.3; fi + if [ "${{ matrix.ansible-version }}" == "devel" ]; then pip install coverage==6.4.4; fi ansible-test coverage xml -v --group-by command --group-by version working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/