@@ -252,15 +252,18 @@ add_W() # Add binarry to workflow command USAGE: add_W [BINARY] [COMMAND_LINE_OP
252252 WORKFLOW+=$WFADD
253253}
254254
255- if [[ " ${GEN_TOPO_DEPLOYMENT_TYPE:- } " == " ALICE_STAGING" ]]; then
256- GEN_TOPO_QC_CONSUL_SERVER=ali-staging.cern.ch
257- else
258- GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch
255+ if [[ ${EPNSYNCMODE:- 0} == 1 && " ${WORKFLOW_PARAMETERS:- } " =~ (^| ,)" QC" (,| $) ]]; then
256+ if [[ " ${GEN_TOPO_DEPLOYMENT_TYPE:- } " == " ALICE_STAGING" ]]; then
257+ GEN_TOPO_QC_CONSUL_SERVER=ali-staging.cern.ch
258+ else
259+ GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch
260+ fi
261+ GEN_TOPO_QC_APRICOT_SERVER=` curl -s " http://${GEN_TOPO_QC_CONSUL_SERVER} :8500/v1/kv/o2/runtime/aliecs/vars/apricot_endpoint?raw" `
259262fi
260- GEN_TOPO_QC_APRICOT_SERVER=` curl -s " http://${GEN_TOPO_QC_CONSUL_SERVER} :8500/v1/kv/o2/runtime/aliecs/vars/apricot_endpoint?raw" `
261263
262264add_QC_from_consul ()
263265{
266+ [[ ${EPNSYNCMODE:- 0} == 1 ]] || { echo " Error fetching QC JSON $1 : consul server only set for EPNSYNCMODE == 1 " 1>&2 && exit 1; }
264267 if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:- } ]]; then
265268 curl -s -o $GEN_TOPO_QC_JSON_FILE " http://${GEN_TOPO_QC_CONSUL_SERVER} :8500/v1/kv${1} ?raw"
266269 if [[ $? != 0 ]]; then
@@ -276,12 +279,13 @@ add_QC_from_consul()
276279
277280add_QC_from_apricot ()
278281{
282+ [[ ${EPNSYNCMODE:- 0} == 1 ]] || { echo " Error fetching QC JSON $1 : apricot server only set for EPNSYNCMODE == 1 " 1>&2 && exit 1; }
279283 if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:- } ]]; then
280- if [[ ${1} =~ " ?" ]]; then
281- curl -s -o $GEN_TOPO_QC_JSON_FILE " ${GEN_TOPO_QC_APRICOT_SERVER} /${1} \&process=true"
282- else
283- curl -s -o $GEN_TOPO_QC_JSON_FILE " ${GEN_TOPO_QC_APRICOT_SERVER} /${1} ?process=true"
284- fi
284+ if [[ ${1} =~ " ?" ]]; then
285+ curl -s -o $GEN_TOPO_QC_JSON_FILE " ${GEN_TOPO_QC_APRICOT_SERVER} /${1} \&process=true"
286+ else
287+ curl -s -o $GEN_TOPO_QC_JSON_FILE " ${GEN_TOPO_QC_APRICOT_SERVER} /${1} ?process=true"
288+ fi
285289 if [[ $? != 0 ]]; then
286290 echo " Error fetching QC JSON $1 "
287291 exit 1
0 commit comments