From 953ee39716b1c57ce2653dc94e23de26a56fe556 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 16 Oct 2024 22:51:54 +0200 Subject: [PATCH] add protection against time-inverted IOVs in the comparator script --- CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator | 1 + .../SiStripPlugins/scripts/testCompareSiStripG2Gains.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator index 285b355527d41..4958161ddbc58 100755 --- a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator +++ b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator @@ -23,6 +23,7 @@ def getCommandOutput(command): if err: print ('%s failed w/ exit code %d' % (command, err)) sys.exit(1) # This will stop the script immediately with the failure exit code + print(data) return data ############################################## diff --git a/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh b/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh index 3d4acc91e316a..7c1474a2b5baa 100755 --- a/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh +++ b/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh @@ -24,6 +24,12 @@ W_DIR=$(pwd) STARTIOV=$2 ENDIOV=$3 +# Check if ENDIOV is greater than or equal to STARTIOV +if (( $ENDIOV < $STARTIOV )); then + echo "Error: ENDIOV ($ENDIOV) is less than STARTIOV ($STARTIOV). Skipping comparisons" + exit 0 +fi + source /cvmfs/cms.cern.ch/cmsset_default.sh eval "$(scram run -sh)"