From d42b8694d125b7c9f6844492d27da7b181cde862 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Sat, 11 Feb 2023 11:34:07 -0500 Subject: [PATCH] Unsuppress pylint E1111 assignment-from-no-return E1111 assignment-from-no-return had being suppressed in pylint.rc and now is no longer being suppressed. This allows future code changes to be validated against this check. - the kubernetes client was suppressing the incorrect code as part of a workaround to support 'None' names. - A unit test was incorrectly assigning the result of a method call and has been updated. These changes have no runtime impact. Test Plan: Pass: tox -e pylint Story: 2010531 Task: 47344 Signed-off-by: Al Bailey Change-Id: I4c2a5ce60c0ceef4328af8ccedcd1e71b1d42330 --- .../nfvi_plugins/clients/kubernetes_client.py | 9 +++------ nfv/nfv-tests/nfv_unit_tests/tests/test_debug_config.py | 2 +- nfv/pylint.rc | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/kubernetes_client.py b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/kubernetes_client.py index 82b66a90..db498a9d 100644 --- a/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/kubernetes_client.py +++ b/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/kubernetes_client.py @@ -29,11 +29,8 @@ DLOG = debug.debug_get_logger('nfv_plugins.nfvi_plugins.clients.kubernetes_clien # in the python Kubernetes client to bypass the "none image" # check because the error is not from kubernetes. # -# This workaround should be removed if the proposed solutions -# can be made in kubernetes or a workaround can be implemented -# in containerd. -# https://github.com/kubernetes/kubernetes/pull/79018 -# https://github.com/containerd/containerd/issues/4771 +# This workaround should be removed when we update to +# kubernetes client v22 def names(self, names): """Monkey patch V1ContainerImage with this to set the names.""" self._names = names @@ -41,7 +38,7 @@ def names(self, names): # Replacing address of "names" in V1ContainerImage # with the "names" defined above -V1ContainerImage.names = V1ContainerImage.names.setter(names) # pylint: disable=no-member +V1ContainerImage.names = V1ContainerImage.names.setter(names) # pylint: disable=assignment-from-no-return def get_client(): diff --git a/nfv/nfv-tests/nfv_unit_tests/tests/test_debug_config.py b/nfv/nfv-tests/nfv_unit_tests/tests/test_debug_config.py index dc02c9e0..f1697855 100755 --- a/nfv/nfv-tests/nfv_unit_tests/tests/test_debug_config.py +++ b/nfv/nfv-tests/nfv_unit_tests/tests/test_debug_config.py @@ -46,5 +46,5 @@ class TestDebugConfig(testcase.NFVTestCase): self.assertEqual(Debug()._debug_level, DEBUG_LEVEL.VERBOSE) # call reload_config to undo the local modification - config = debug.debug_reload_config() + debug.debug_reload_config() self.assertNotEqual(Debug()._debug_level, DEBUG_LEVEL.VERBOSE) diff --git a/nfv/pylint.rc b/nfv/pylint.rc index c274d7a4..17f8d5a3 100755 --- a/nfv/pylint.rc +++ b/nfv/pylint.rc @@ -100,7 +100,6 @@ disable= W0237, # arguments-renamed W4905, # deprecated-decorator E1101, # no-member - E1111, # assignment-from-no-return E1121 # too-many-function-args [REPORTS] @@ -277,6 +276,5 @@ valid-classmethod-first-arg=cls [EXCEPTIONS] -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception