diff --git a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator index e8ff3982a953a..4958161ddbc58 100755 --- a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator +++ b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator @@ -1,21 +1,13 @@ #!/usr/bin/env python3 -from __future__ import print_function - from datetime import datetime -import ROOT import configparser as ConfigParser -import datetime -import glob import json -import numpy import optparse import os -import re import sqlalchemy import string import subprocess import sys -import time import CondCore.Utilities.conddblib as conddb ############################################## @@ -31,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 ############################################## @@ -290,7 +283,7 @@ if __name__ == "__main__": for i,theValidationTagSince in enumerate(IOVsToValidate): # Construct the conddb_import command, modifying the 'since' value if necessary - since_value = FCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince + since_value = HLTFCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince command = ( f'conddb_import -c sqlite_file:toCompare.db ' f'-f frontier://FrontierPrep/CMS_CONDITIONS ' @@ -299,13 +292,13 @@ if __name__ == "__main__": # Print and execute the conddb_import command if theValidationTagSince < lastG2Payload[0]: - print("The last available IOV in the validation tag is older than the current last express IOV, taking FCSR as a since!") + print("The last available IOV in the validation tag is older than the current last express IOV, taking Express FCSR (HLT) as a since!") print(command) getCommandOutput(command) # Construct the testCompareSiStripG2Gains.sh command, adjusting the 'since' value similarly - since_value = FCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince + since_value = HLTFCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince command = ( f'${{CMSSW_BASE}}/src/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh ' f'{Tag} {lastG2Payload[0]} {since_value} {current_directory}/toCompare.db' 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)"