I tried to describe the Hook when a queue is not specified in the qsub.
I referred to the sample on p. 264 of the PBS Professional 2022.1 Hooks Guide, but it does not work properly.
If I specify a queue, it works properly.
The created HOOK is as follows
import pbs
e = pbs.event()
if e.job.queue == None:
target_qname = pbs.server().default_queue
else:
target_qname = e.job.queue.name
if e.job.interactive:
e.job.Resource_List['walltime'] = pbs.duration('48:00:00')
if target_qname == "workq":
e.job.Resource_List['walltime'] = pbs.duration('00:30:00')
e.accept()
The error at runtime is as follows
11/10/2022 15:44:44;0001;Server@centos73-hh;Svr;Server@centos73-hh;PBS server internal error (15011) in Error evaluating Python script, <type 'exceptions.AttributeError'>
11/10/2022 15:44:44;0001;Server@centos73-hh;Svr;Server@centos73-hh;PBS server internal error (15011) in Error evaluating Python script, 'str' object has no attribute 'name'
11/10/2022 15:44:44;0100;Server@centos73-hh;Hook;walltime;queuejob hook 'walltime' encountered an exception, request rejected
The example in the manual does not work properly.
Any advice would be appreciated!