From c340ff65829cef8d7b48d183a3477536ee29e608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 23 Sep 2021 01:55:47 -0400 Subject: [PATCH] pylint: ignore a use-a-generator message (#118) Follow up to the recent upgrade of pylint in the devel branch, we've got a new use-a-generator error in k8s.py: Use a generator instead 'all(desired.get(key, True) == item.get(key, False) for key in keys)' This commit disables the error until we've got time to rewrite this part. Also, since the older branches still use an ancient version of pylint, we've got another message saying the error does not exist (yet!). This commit also adds the right entries in the ignore files. --- plugins/modules/k8s.py | 1 + tests/sanity/ignore-2.10.txt | 1 + tests/sanity/ignore-2.11.txt | 1 + tests/sanity/ignore-2.9.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index 17e71d9..47ee3a4 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -396,6 +396,7 @@ class OKDRawModule(K8sAnsibleMixin): """ Iterates over keys, returns the first object from objects where the value of the key matches the value in desired """ + # pylint: disable=use-a-generator for i, item in enumerate(objects): if item and all([desired.get(key, True) == item.get(key, False) for key in keys]): return i diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 20ecba7..fde871c 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,3 +1,4 @@ plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc plugins/modules/k8s.py validate-modules:return-syntax-error +plugins/modules/k8s.py pylint:bad-option-value plugins/modules/openshift_process.py validate-modules:parameter-type-not-in-doc diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 20ecba7..fde871c 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,3 +1,4 @@ plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc plugins/modules/k8s.py validate-modules:return-syntax-error +plugins/modules/k8s.py pylint:bad-option-value plugins/modules/openshift_process.py validate-modules:parameter-type-not-in-doc diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index a8af3e8..6ca7504 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,2 +1,3 @@ plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc +plugins/modules/k8s.py pylint:bad-option-value plugins/modules/openshift_process.py validate-modules:parameter-type-not-in-doc