From 8199379657a6fc736297aceffe48d687731b1dc2 Mon Sep 17 00:00:00 2001 From: Ed Velez Date: Tue, 19 Mar 2024 13:28:36 -0500 Subject: [PATCH 1/4] Lock pylint version to 2.17.x --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b12677ce..3f7e16a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { sh '''apt-get update apt-get install -y python3-pip python3-psycopg2 rsync pip3 install configobj -pip3 install pylint +pip3 install 'pylint>=2.17.0,<3.0.0' pip3 install six python3 --version''' } From 55c516aacbac1c4cae0c3a97375e561720e0839a Mon Sep 17 00:00:00 2001 From: Ed Velez Date: Tue, 19 Mar 2024 13:33:46 -0500 Subject: [PATCH 2/4] Specify module name in overgeneral-exceptions --- .pylintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 71d39b9c..c58542c9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -215,8 +215,8 @@ min-public-methods=1 [EXCEPTIONS] # Exceptions that will emit a warning when caught. -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtins.BaseException, + builtins.Exception [FORMAT] From a4b701b6e22ce26ef732fe7ddad088c30f38c881 Mon Sep 17 00:00:00 2001 From: Ed Velez Date: Tue, 19 Mar 2024 13:35:47 -0500 Subject: [PATCH 3/4] Use dict literal instead of call to dict --- plugins/holland.lib.mysql/holland/lib/mysql/option/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/option/base.py b/plugins/holland.lib.mysql/holland/lib/mysql/option/base.py index 4032ed25..a040b61a 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/option/base.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/option/base.py @@ -2,6 +2,7 @@ http://dev.mysql.com/doc/refman/5.1/en/option-files.html """ + import codecs import logging import os @@ -13,7 +14,7 @@ def merge_options(*defaults_files): """Merge multiple defaults files together""" - defaults_config = dict(client={}) + defaults_config = {"client": {}} def merge(dst_dict, src_dict): """Merge two dictionaries non-destructively""" From 3ac52eacd04dae31cdac59c39bb9e72a829fe418 Mon Sep 17 00:00:00 2001 From: Ed Velez Date: Tue, 19 Mar 2024 13:38:11 -0500 Subject: [PATCH 4/4] Remove unnecessary else after raise/return --- contrib/holland-commvault/holland_commvault/commvault.py | 3 +-- holland/core/util/lock.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/contrib/holland-commvault/holland_commvault/commvault.py b/contrib/holland-commvault/holland_commvault/commvault.py index 3f29efa8..8fd55c46 100644 --- a/contrib/holland-commvault/holland_commvault/commvault.py +++ b/contrib/holland-commvault/holland_commvault/commvault.py @@ -156,8 +156,7 @@ def main(): except IOError: logging.info("Holland (commvault agent) failed to open/read status file") return 1 - else: - status.close() + status.close() return ret except IOError as ex: logging.warning("Holland (commvault agent) IOError: %r", ex) diff --git a/holland/core/util/lock.py b/holland/core/util/lock.py index fb709d13..c78e78b2 100644 --- a/holland/core/util/lock.py +++ b/holland/core/util/lock.py @@ -31,8 +31,7 @@ def acquire(self): except IOError as exc: self.lock = None raise LockError(str(exc), exc) - else: - return True + return True def is_locked(self): """Check for lock""" @@ -48,5 +47,4 @@ def release(self): self.lock = None except IOError as exc: raise LockError(str(exc), exc) - else: - return True + return True