Skip to content

Commit

Permalink
backend: copr-backend-resultdir-cleaner logs into config["log_dir"]
Browse files Browse the repository at this point in the history
Relates: #3494
  • Loading branch information
praiskup committed Nov 6, 2024
1 parent fa9ac64 commit 208d68b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/run/copr-backend-resultdir-cleaner
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 208d68b

Please sign in to comment.