(re)enable SGE queue only if disable by a script

Test if /etc/.sge.${QUEUE_NAME}.disable exist
This commit is contained in:
Jeremy Gardais 2020-06-22 13:25:34 +02:00
parent 138aecfb47
commit 3d01cb8487
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 12 additions and 6 deletions

View File

@ -218,13 +218,19 @@ enable_sge_queue() { # {{{
local_sge_hostname="${1}" local_sge_hostname="${1}"
local_sge_queue_name="${2}" local_sge_queue_name="${2}"
## Simple debug message to valid current variables local_sge_disable="/etc/.sge.${local_sge_queue_name}.disable"
debug_message "enable_sge_queue \
Try to enable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}."
## SGE command to enable the queue ## If the queue was previously disabled by another script
qmod --enable "${local_sge_queue_name}@${local_sge_hostname}" \ if [ -f "${local_sge_disable}" ]; then
&& return_enable_queue="${?}" debug_message "enable_sge_queue \
Try to enable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}."
## SGE command to enable the queue
qmod --enable "${local_sge_queue_name}@${local_sge_hostname}" \
&& return_enable_queue="${?}"
else
debug_message "SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${RESET} was manually disabled, please re-enable it ${RED}manually${RESET}."
return_enable_queue="1"
fi
return "${return_enable_queue}" return "${return_enable_queue}"