raise an error if the anchor year for a production cannot be retrieved
authormkrzewic <mikolaj.krzewicki@cern.ch>
Thu, 5 Jun 2014 13:34:15 +0000 (15:34 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Thu, 5 Jun 2014 13:34:50 +0000 (15:34 +0200)
PWGPP/QA/scripts/runQA.sh

index 339fba0..b5eb8b7 100755 (executable)
@@ -537,6 +537,10 @@ guessRunData()
   if [[ ${dataType} =~ sim ]]; then 
     anchorYear=$(for x in $mcProductionMap ; do [[ "${x}" =~ ${originalPeriod} ]] && echo ${x} && break; done)
     anchorYear=${anchorYear#*=}
+    if [[ -z "${anchorYear}" ]]; then
+      echo WARNING: anchorYear not available for this production: ${originalPeriod}, cannot set the OCDB."
+      return 1
+    fi
     ocdbStorage=$(setYear ${anchorYear} ${ocdbStorage})
   else
     ocdbStorage=$(setYear ${year} ${ocdbStorage})