+ try:
+ self._set_node_state('RESUME')
+ except subprocess.CalledProcessError:
+ slum_state = self._get_slurm_state()
+ if slum_state in self.SLURM_DRAIN_STATES:
+ # We expect to be able to resume from "drain" or "drng"
+ # So if scontrol exited non-zero, something actually failed, so
+ # raise an exception to signal the retry to kick in.
+ raise
+ else:
+ # Assume scontrol exited non-zero because the node is already in
+ # 'idle' or 'alloc' (so it never started draining)
+ # we don't need to do anything else resume it.
+ pass