From ff96a4112bfbf42644252cd5bc4e7ccbf4742125 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Mon, 14 Nov 2022 11:48:01 +0100 Subject: [PATCH] Fix ansible sanity job The ansible sanity job was failing because the new node that runs the job was updated and no longer have python 3.8. In order to use python 3.10 you need to update ansible-core to at least 2.13, doing so, it also requires that we add the ignore-2.13.txt, and update the zuul.d/layout.yaml. The pylint complains then about use-a-generator, so adding a comment in sova.py to ignore it for now The new node that runs tox requires new python version Change-Id: I1370d41b0c4e057c1c65cfd75ff945d648696771 --- plugins/modules/sova.py | 4 ++++ tests/sanity/ignore-2.13.txt | 1 + tox.ini | 2 +- zuul.d/layout.yaml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 tests/sanity/ignore-2.13.txt diff --git a/plugins/modules/sova.py b/plugins/modules/sova.py index df82e11..1d09afe 100644 --- a/plugins/modules/sova.py +++ b/plugins/modules/sova.py @@ -173,6 +173,7 @@ class Pattern(object): return self._patterns +# pylint: disable=use-a-generator def line_match(pat, line, exclude=None): if isinstance(pat, str): return pat in line @@ -187,6 +188,9 @@ def line_match(pat, line, exclude=None): return True +# pylint: enable=use-a-generator + + def parse(text_file, patterns): ids = [] msgs = [] diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt new file mode 120000 index 0000000..0c39ad8 --- /dev/null +++ b/tests/sanity/ignore-2.13.txt @@ -0,0 +1 @@ +ignore-2.10.txt \ No newline at end of file diff --git a/tox.ini b/tox.ini index f803f74..190d186 100644 --- a/tox.ini +++ b/tox.ini @@ -75,7 +75,7 @@ description = Used as base for all tox-ansible environments [testenv:sanity] usedevelop = False deps = - ansible-core>=2.11,<2.12 + ansible-core>=2.11,<2.14 [testenv:units] usedevelop = False diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml index e7c5159..0e12237 100644 --- a/zuul.d/layout.yaml +++ b/zuul.d/layout.yaml @@ -6,7 +6,7 @@ vars: tox_envlist: sanity # dynamic tox env added by tox-ansible # we want to run sanity only on py38 instead of implicit 2.6-3.9 range - tox_extra_args: -- --python 3.8 + tox_extra_args: -- --python 3.10 - job: name: tox-ansible-test-units