diff options
author | GomathiselviS <gomathiselvi@gmail.com> | 2021-02-18 15:26:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 20:26:33 +0000 |
commit | b739944aabe5d3c287a89544fc365382d2719070 (patch) | |
tree | c612c86a6913549c05ab813fd85744c6807b9c5c | |
parent | 4e8356f7ae00e55ea7554b9c817141035e40826b (diff) | |
download | vyos-ansible-old-b739944aabe5d3c287a89544fc365382d2719070.tar.gz vyos-ansible-old-b739944aabe5d3c287a89544fc365382d2719070.zip |
Fix test-sanity-docker failures (#124)
Fix test-sanity-docker failures
Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
https://github.com/Qalthos
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | changelogs/fragments/fix_docker_sanity_test_failures.yaml | 3 | ||||
-rw-r--r-- | meta/runtime.yml | 2 | ||||
-rw-r--r-- | plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py | 24 | ||||
-rw-r--r-- | plugins/modules/vyos_l3_interface.py | 4 | ||||
-rw-r--r-- | tests/sanity/ignore-2.10.txt | 2 | ||||
-rw-r--r-- | tests/sanity/ignore-2.11.txt | 3 | ||||
-rw-r--r-- | tests/sanity/ignore-2.9.txt | 2 |
8 files changed, 29 insertions, 13 deletions
@@ -10,7 +10,7 @@ This collection has been tested against VyOS 1.1.8 (helium). <!--start requires_ansible--> ## Ansible version compatibility -This collection has been tested against following Ansible versions: **>=2.9.10,<2.11**. +This collection has been tested against following Ansible versions: **>=2.9.10**. Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. diff --git a/changelogs/fragments/fix_docker_sanity_test_failures.yaml b/changelogs/fragments/fix_docker_sanity_test_failures.yaml new file mode 100644 index 0000000..3f02049 --- /dev/null +++ b/changelogs/fragments/fix_docker_sanity_test_failures.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Fix failures in test-sanity-docker (https://github.com/ansible-collections/arista.eos/pull/172). diff --git a/meta/runtime.yml b/meta/runtime.yml index 00bbaca..e68ed60 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,5 +1,5 @@ --- -requires_ansible: '>=2.9.10,<2.11' +requires_ansible: '>=2.9.10' plugin_routing: action: vyos_banner: diff --git a/plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py b/plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py index d01b1e0..c7590ee 100644 --- a/plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py +++ b/plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py @@ -76,8 +76,12 @@ class Ospf_interfaces(ResourceModule): """Generate configuration commands to send based on want, have and desired state. """ - wantd = {entry["name"]: entry for entry in self.want} - haved = {entry["name"]: entry for entry in self.have} + wantd = {} + haved = {} + for entry in self.want: + wantd.update({entry["name"]: entry}) + for entry in self.have: + haved.update({entry["name"]: entry}) # turn all lists of dicts into dicts prior to merge for entry in wantd, haved: @@ -88,9 +92,11 @@ class Ospf_interfaces(ResourceModule): # if state is deleted, empty out wantd and set haved to wantd if self.state == "deleted": - haved = { - k: v for k, v in iteritems(haved) if k in wantd or not wantd - } + h_del = {} + for k, v in iteritems(haved): + if k in wantd or not wantd: + h_del.update({k: v}) + haved = h_del have_int = [] for k, have in iteritems(haved): if k in wantd: @@ -157,8 +163,8 @@ class Ospf_interfaces(ResourceModule): def _ospf_int_list_to_dict(self, entry): for name, family in iteritems(entry): if "address_family" in family: - family["address_family"] = { - entry["afi"]: entry - for entry in family.get("address_family", []) - } + addr_dict = {} + for entry in family.get("address_family", []): + addr_dict.update({entry["afi"]: entry}) + family["address_family"] = addr_dict self._ospf_int_list_to_dict(family["address_family"]) diff --git a/plugins/modules/vyos_l3_interface.py b/plugins/modules/vyos_l3_interface.py index 88b5a91..214022a 100644 --- a/plugins/modules/vyos_l3_interface.py +++ b/plugins/modules/vyos_l3_interface.py @@ -104,13 +104,13 @@ EXAMPLES = """ vyos.vyos.vyos_l3_interface: aggregate: - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: fd5d:12c9:2201:1::1/64} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} - name: Remove IP addresses on aggregate vyos.vyos.vyos_l3_interface: aggregate: - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: fd5d:12c9:2201:1::1/64} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} state: absent """ diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index c835eef..a44822b 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1 +1,3 @@ plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py compile-2.6!skip +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py import-2.6!skip diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt new file mode 100644 index 0000000..a44822b --- /dev/null +++ b/tests/sanity/ignore-2.11.txt @@ -0,0 +1,3 @@ +plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py compile-2.6!skip +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py import-2.6!skip diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 8f3fd9c..68064bb 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -11,3 +11,5 @@ plugins/modules/vyos_lldp.py validate-modules:invalid-documentation # removed_at plugins/modules/vyos_lldp_interface.py validate-modules:deprecation-mismatch # 2.9 expects METADATA plugins/modules/vyos_lldp_interface.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py compile-2.6!skip +plugins/module_utils/network/vyos/config/ospf_interfaces/ospf_interfaces.py import-2.6!skip |