Skip to content

Commit

Permalink
Merge pull request #5442 from cms-sw/crab-cmssw-pythonpath
Browse files Browse the repository at this point in the history
keep cmssw PYTHONPATH saved in CRAB_CMSSW_SITE_PACKAGES
  • Loading branch information
smuzaffar committed Dec 19, 2019
2 parents 2cfe8a2 + c290e55 commit edaa7b0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
17 changes: 13 additions & 4 deletions _crab-startup.file
Expand Up @@ -3,7 +3,7 @@
# **************** IMPORTANT NOTE ***************** #
# Increament Crab Startup Revision for every change #
#####################################################
CRAB_STARTUP_REVISION=1
CRAB_STARTUP_REVISION=2

#Check if we have not already found CRAB
if [ -z "${CMS_CRAB_PATH}" ] ; then
Expand All @@ -23,9 +23,17 @@ if [ -z "${CMS_CRAB_PATH}" ] ; then
export CMS_CRAB_PATH="${crab_dir}"
export CRAB_VERSION=$(basename ${crab_dir})

#Save CMSSW_BASE in case we have to set its env later
export ORIGINAL_CMSSW_BASE="${CMSSW_BASE}"

#Save CMSSW_BASE, and PYTHONPATH in case we have to set its env later
ORIGINAL_CMSSW_BASE="${CMSSW_BASE}"
CRAB_CMSSW_SITE_PACKAGES=""
for pyenv in PYTHONPATH PYTHON27PATH PYTHON3PATH ; do
for ext in DEL '' ; do
eval "CRAB_CMSSW_SITE_PACKAGES=\${SRT_${pyenv}_SCRAMRT${ext}}"
[ -z "${CRAB_CMSSW_SITE_PACKAGES}" ] || break
done
[ -z "${CRAB_CMSSW_SITE_PACKAGES}" ] || break
done

#Unset cmssw env
eval `scram unset -sh`

Expand All @@ -52,6 +60,7 @@ if [ -z "${CMS_CRAB_PATH}" ] ; then
## The submit command will know what to do if this variable is set!
## See TODO: add link to an hypothetical twiki
export CRAB3_BOOTSTRAP_DIR="$BOOTSTRAP_OUT"
export CRAB_CMSSW_SITE_PACKAGES
fi
else
CRAB3_BOOTSTRAP_DIR=""
Expand Down
2 changes: 1 addition & 1 deletion crab-dev.spec
@@ -1,4 +1,4 @@
### RPM cms crab-dev 3.3.1912.rc1
### RPM cms crab-dev 3.3.1912.rc2
%define wmcore_version 1.2.8
%define crabserver_version 3.3.1912.rc4
%define dbs_version 3.10.0
Expand Down
2 changes: 1 addition & 1 deletion crab-pre.spec
@@ -1,4 +1,4 @@
### RPM cms crab-pre 3.3.1912.rc1
### RPM cms crab-pre 3.3.1912.rc2
%define wmcore_version 1.2.8
%define crabserver_version 3.3.1912.rc4
%define dbs_version 3.10.0
Expand Down
2 changes: 1 addition & 1 deletion crab.spec
@@ -1,4 +1,4 @@
### RPM cms crab 3.3.1912.rc1
### RPM cms crab 3.3.1912.rc2
%define wmcore_version 1.2.8
%define crabserver_version 3.3.1912.rc4
%define dbs_version 3.10.0
Expand Down

0 comments on commit edaa7b0

Please sign in to comment.