From 208d68b52d44f356bcf56f61efa6265373695ab7 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 5 Nov 2024 15:46:32 +0100 Subject: [PATCH] backend: copr-backend-resultdir-cleaner logs into config["log_dir"] Relates: #3494 --- backend/run/copr-backend-resultdir-cleaner | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/run/copr-backend-resultdir-cleaner b/backend/run/copr-backend-resultdir-cleaner index d9b41f95f..0accc2552 100755 --- a/backend/run/copr-backend-resultdir-cleaner +++ b/backend/run/copr-backend-resultdir-cleaner @@ -171,15 +171,14 @@ def clean_in(resultdir, dry_run=True): def _main(): logging.basicConfig(level=logging.DEBUG) - setup_script_logger(LOG, "/var/log/copr-backend/resultdir-cleaner.log") + config_file = os.environ.get("BACKEND_CONFIG", "/etc/copr/copr-be.conf") + opts = BackendConfigReader(config_file).read() + setup_script_logger(LOG, os.path.join(opts["log_dir"], "resultdir-cleaner.log")) args = _get_arg_parser().parse_args() dry_run = not args.real_run if dry_run: LOG.warning("Just doing dry run, run with --real-run") - config_file = os.environ.get("BACKEND_CONFIG", "/etc/copr/copr-be.conf") - opts = BackendConfigReader(config_file).read() - clean_in(opts.destdir, dry_run=dry_run)