diff --git a/hook_job_cleanup.py b/hook_job_cleanup.py index 64dbe4f7b4760a587f6d9c0036340be00d89eb1e..192dfc50075624ecafb7d9825b9e002ae8389e91 100644 --- a/hook_job_cleanup.py +++ b/hook_job_cleanup.py @@ -11,6 +11,7 @@ try: j = e.job jobid = str(j.jobid) username = str(j.euser) + pbs.logmsg(pbs.LOG_DEBUG,f"TESTING mom_node_cleanup - IGNORE ME: {jobid},{username}") if e.type == pbs.EXECJOB_PROLOGUE: op = "-p" @@ -19,11 +20,15 @@ try: op = "-e" which = "EXECJOB_EPILOGUE" else: - e.reject(f"The cleanup script should only be called from the execjob_[prologue|epilogue] events; It was called from {e.type}") + message = f"The cleanup script should only be called from the execjob_[prologue|epilogue] events; It was called from {e.type}" + pbs.logmsg(pbs.LOG_DEBUG,message) +# e.reject(message) # tool = "clean-node.sh" tool = "/usr/bin/logger" subprocess.run([tool, op, jobid, username], timeout = 10, shell = False) e.accept() except Exception as ex: - e.reject(f"hook_job_cleanup.py threw an exception on jobid {jobid} for user {username}: {ex}") + message = f"hook_job_cleanup.py threw an exception on jobid {jobid} for user {username}: {ex}" + pbs.logmsg(pbs.LOG_DEBUG,message) +# e.reject(message)