Iāve looked into your design. So weāll need the actual name of the hook event (e.g. queuejob, modifyjob, periodic, etcā¦), and the parameters accompanying the hook event. So the way I read it, is that you want the hook event to run the hook script whenever thereās a change in state of the node. I was thinking maybe making this more generic. That is, a hook that runs whenever thereās an update to a vnode attribute, although for now, only the āstateā change value would trigger this hook. How about this idea:
name of hook event: modifyvnode
Python global constant: pbs.MODIFYVNODE
Parameters:
pbs.event().vnode_o - vnode object view of the vnode before the state change (original state or other attribute values)
pbs.event().vnode - vnode object view now, including the state change (and other attributes)
So in the Python script, one would see:
pbs.event().vnode_o.state - example pbs.ND_FREE <- old state value
pbs.event().vnode.state - example pbs.ND_DOWN <- new state value
State values actually already have global constants that can be matched as in:
pbs.ND_FREE
pbs.ND_OFFLINE
pbs.ND_DOWN
pbs.ND_STALE
pbs.ND_JOBBUSY
pbs.ND_JOB_EXCLUSIVE
pbs.ND_RESV_EXCLUSIVE
pbs.ND_BUSY
pbs.ND_STATE_UNKNOWN
pbs.ND_PROV
pbs.ND_WAIT_PROV
pbs.ND_UNRESOLVABLE
pbs.ND_SLEEP