From 43be02983ba7a2c0044f6507f433511ed2a32cef Mon Sep 17 00:00:00 2001 From: Ruchi Pakhle Date: Thu, 19 Dec 2024 14:06:08 +0530 Subject: [PATCH] changes --- .../vrf_address_family/vrf_address_family.py | 8 +--- .../tests/common/_remove_config.yaml | 1 + .../tests/common/merged.yaml | 41 ++++++++----------- .../tests/common/overridden.yaml | 40 ++++++++---------- .../tests/common/rendered.yaml | 40 ++++++++---------- .../tests/common/replaced.yaml | 40 ++++++++---------- 6 files changed, 66 insertions(+), 104 deletions(-) diff --git a/plugins/module_utils/network/ios/facts/vrf_address_family/vrf_address_family.py b/plugins/module_utils/network/ios/facts/vrf_address_family/vrf_address_family.py index 046caf6c3..30c297bef 100644 --- a/plugins/module_utils/network/ios/facts/vrf_address_family/vrf_address_family.py +++ b/plugins/module_utils/network/ios/facts/vrf_address_family/vrf_address_family.py @@ -14,7 +14,7 @@ based on the configuration. """ -# from ansible.module_utils.six import iteritems + from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import ( utils, ) @@ -28,10 +28,6 @@ flatten_config, ) -# import debugpy -# debugpy.listen(3000) -# debugpy.wait_for_client() - class Vrf_address_familyFacts(object): """ The ios vrf_address_family facts class @@ -63,8 +59,6 @@ def populate_facts(self, connection, ansible_facts, data=None): if not data: data = self.get_config(connection) - # export_data = flatten_config(data, "export") - # import_data = flatten_config(export_data, "import") address_data = flatten_config(data, "address-family") data = flatten_config(address_data, "vrf") diff --git a/tests/integration/targets/ios_vrf_address_family/tests/common/_remove_config.yaml b/tests/integration/targets/ios_vrf_address_family/tests/common/_remove_config.yaml index 478ef8f22..68998e73b 100644 --- a/tests/integration/targets/ios_vrf_address_family/tests/common/_remove_config.yaml +++ b/tests/integration/targets/ios_vrf_address_family/tests/common/_remove_config.yaml @@ -6,4 +6,5 @@ - no vrf definition VRF6 - no vrf definition VRF7 - no vrf definition test + - no vrf definition test1 register: result diff --git a/tests/integration/targets/ios_vrf_address_family/tests/common/merged.yaml b/tests/integration/targets/ios_vrf_address_family/tests/common/merged.yaml index 9847dbcbd..db1c24995 100644 --- a/tests/integration/targets/ios_vrf_address_family/tests/common/merged.yaml +++ b/tests/integration/targets/ios_vrf_address_family/tests/common/merged.yaml @@ -16,34 +16,25 @@ next_hop: loopback: 40 export: - # ipv4: - # multicast: - # map: "single" - # prefix: 345 - # unicast: - # allow_evpn: true - # map: "test-map" - # prefix: 67 + ipv4: + multicast: + map: "single" + prefix: 345 + unicast: + allow_evpn: true + map: "test-map" + prefix: 67 map: "testing-map" import_config: - # ipv4: - # multicast: - # map: "import-map" - # prefix: 89 - # unicast: - # allow_evpn: true - # limit: 12 - # map: "ran-map" + ipv4: + multicast: + map: "import-map" + prefix: 89 + unicast: + allow_evpn: true + limit: 12 + map: "ran-map" map: "import-map" - # inter_as_hybrid: - # csc: - # next_hop: "1.2.3.4" - # next_hop: "1.0.0.0" - # maximum: - # routes: - # limit: 2 - # warning_only: true - state: merged register: result - name: Assert that correct set of commands were generated diff --git a/tests/integration/targets/ios_vrf_address_family/tests/common/overridden.yaml b/tests/integration/targets/ios_vrf_address_family/tests/common/overridden.yaml index c6f1649ab..6459a6086 100644 --- a/tests/integration/targets/ios_vrf_address_family/tests/common/overridden.yaml +++ b/tests/integration/targets/ios_vrf_address_family/tests/common/overridden.yaml @@ -18,33 +18,25 @@ next_hop: loopback: 56 export: - # ipv4: - # multicast: - # map: "single" - # prefix: 345 - # unicast: - # allow_evpn: true - # map: "test-map" - # prefix: 67 + ipv4: + multicast: + map: "single" + prefix: 345 + unicast: + allow_evpn: true + map: "test-map" + prefix: 67 map: "testing-map" import_config: - # ipv4: - # multicast: - # map: "import-map" - # prefix: 89 - # unicast: - # allow_evpn: true - # limit: 12 - # map: "ran-map" + ipv4: + multicast: + map: "import-map" + prefix: 89 + unicast: + allow_evpn: true + limit: 12 + map: "ran-map" map: "import-map" - # inter_as_hybrid: - # csc: - # next_hop: "1.2.3.4" - # next_hop: "1.0.0.0" - # maximum: - # routes: - # limit: 2 - # warning_only: true state: overridden register: result diff --git a/tests/integration/targets/ios_vrf_address_family/tests/common/rendered.yaml b/tests/integration/targets/ios_vrf_address_family/tests/common/rendered.yaml index 4feda816d..60428946d 100644 --- a/tests/integration/targets/ios_vrf_address_family/tests/common/rendered.yaml +++ b/tests/integration/targets/ios_vrf_address_family/tests/common/rendered.yaml @@ -15,33 +15,25 @@ next_hop: loopback: 40 export: - # ipv4: - # multicast: - # map: "single" - # prefix: 345 - # unicast: - # allow_evpn: true - # map: "test-map" - # prefix: 67 + ipv4: + multicast: + map: "single" + prefix: 345 + unicast: + allow_evpn: true + map: "test-map" + prefix: 67 map: "testing-map" import_config: - # ipv4: - # multicast: - # map: "import-map" - # prefix: 89 - # unicast: - # allow_evpn: true - # limit: 12 - # map: "ran-map" + ipv4: + multicast: + map: "import-map" + prefix: 89 + unicast: + allow_evpn: true + limit: 12 + map: "ran-map" map: "import-map" - # inter_as_hybrid: - # csc: - # next_hop: "1.2.3.4" - # next_hop: "1.0.0.0" - # maximum: - # routes: - # limit: 2 - # warning_only: true state: rendered register: result diff --git a/tests/integration/targets/ios_vrf_address_family/tests/common/replaced.yaml b/tests/integration/targets/ios_vrf_address_family/tests/common/replaced.yaml index dd058de07..f69b43418 100644 --- a/tests/integration/targets/ios_vrf_address_family/tests/common/replaced.yaml +++ b/tests/integration/targets/ios_vrf_address_family/tests/common/replaced.yaml @@ -18,33 +18,25 @@ next_hop: loopback: 40 export: - # ipv4: - # multicast: - # map: "single" - # prefix: 345 - # unicast: - # allow_evpn: true - # map: "test-map" - # prefix: 67 + ipv4: + multicast: + map: "single" + prefix: 345 + unicast: + allow_evpn: true + map: "test-map" + prefix: 67 map: "testing-map" import_config: - # ipv4: - # multicast: - # map: "import-map" - # prefix: 89 - # unicast: - # allow_evpn: true - # limit: 12 - # map: "ran-map" + ipv4: + multicast: + map: "import-map" + prefix: 89 + unicast: + allow_evpn: true + limit: 12 + map: "ran-map" map: "import-map" - # inter_as_hybrid: - # csc: - # next_hop: "1.2.3.4" - # next_hop: "1.0.0.0" - # maximum: - # routes: - # limit: 2 - # warning_only: true state: replaced register: result