From b9ab2e9bea9bddf86c64bc97e5e82f3d89018506 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Mon, 23 Sep 2024 12:03:38 +0800 Subject: [PATCH] Replace space in error log file name of product and version And remove some invalid option for pylint checker --- .pylintrc | 9 ++++----- charon/utils/logs.py | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pylintrc b/.pylintrc index 64c48ba..5181776 100644 --- a/.pylintrc +++ b/.pylintrc @@ -24,8 +24,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -enable=all, - python3 +enable=all disable=I, R, # refactoring checks abstract-method, # nice to have @@ -34,14 +33,14 @@ disable=I, bad-whitespace, # pep8, nice to have broad-except, comprehension-escape, # throws false positives on 1.9.0 (Fedora 29) - deprecated-lambda, # nice to have + ; deprecated-lambda, # nice to have import-outside-toplevel, import-error, # requires to having all modules installed invalid-name, len-as-condition, # nice to have line-too-long, # pep8, should be enabled missing-docstring, - misplaced-comparison-constant, + ; misplaced-comparison-constant, multiple-statements, # nice to have no-absolute-import, # it was required for py2 no-init, @@ -51,7 +50,7 @@ disable=I, old-division, # it was required for py2 protected-access, redefined-outer-name, # nice to have - relative-import, # nice to have + ; relative-import, # nice to have super-init-not-called, # nice to have superfluous-parens, # nice to have too-many-lines, diff --git a/charon/utils/logs.py b/charon/utils/logs.py index 9e27364..7725af5 100644 --- a/charon/utils/logs.py +++ b/charon/utils/logs.py @@ -81,8 +81,10 @@ def set_logging( def set_log_file_handler(product: str, version: str, logger: logging): + prd = product.replace(" ", "_") + ver = version.replace(" ", "_") log_loc = os.getenv("ERROR_LOG_LOCATION") - error_log = "".join([product, "-", version, ".", DEFAULT_ERRORS_LOG]) + error_log = "".join([prd, "-", ver, ".", DEFAULT_ERRORS_LOG]) if log_loc: os.makedirs(log_loc, exist_ok=True) error_log = os.path.join(log_loc, error_log)