dmwm / CRABServer

15 stars 37 forks source link

Fix pre job #8507

Closed belforte closed 1 week ago

belforte commented 1 week ago

this fixes a bug in previous commit f700045273ff40d510dea30441fd2eccde053af3 which I introduced after testing, when I fixed pylint warnings in PreJob.py in line https://github.com/dmwm/CRABServer/blob/e6eb58703768825380e22efebd14889411d8c52a/src/python/TaskWorker/Actions/PreJob.py#L516a

fd_prejob_log = os.open(prejob_log_file_name, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o644)

and replaced it with https://github.com/dmwm/CRABServer/blob/f700045273ff40d510dea30441fd2eccde053af3/src/python/TaskWorker/Actions/PreJob.py#L516 which could not possibly work.

In the end I decided to replace the obscure use of os.open() and os.dup2 with plain calls to logging.logger.

novicecpp commented 1 week ago

Stefano, could you please provide the information why you need this PR? Usually, you have issue number in the PR but not this one.

belforte commented 1 week ago

I have added a description at the top.

novicecpp commented 1 week ago

Thanks! :+1: