diff --git a/.gitignore b/.gitignore index 0d20b6487..788301772 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *.pyc +.project +.pydevproject +tags diff --git a/etc/init-light.sh b/etc/init-light.sh new file mode 100644 index 000000000..c488e83b4 --- /dev/null +++ b/etc/init-light.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +if [ -z "$CRAB_SOURCE_SCRIPT" ]; then + CRAB_SOURCE_SCRIPT="/cvmfs/cms.cern.ch/crab3/crab.sh" +fi + +function getVariableValue { + VARNAME=$1 + SUBDIR=$2 + sh -c "source $CRAB_SOURCE_SCRIPT >/dev/null 2>/dev/null; if [ \$? -eq 0 ] && [ -d $VARNAME ]; \ + then echo $VARNAME/$SUBDIR; else exit 1; fi" +} + +CRAB3_BIN_ROOT=$(getVariableValue \$CRABCLIENT_ROOT bin) +CRAB3_ETC_ROOT=$(getVariableValue \$CRABCLIENT_ROOT etc) +CRAB3_PY_ROOT=$(getVariableValue \$CRABCLIENT_ROOT \$PYTHON_LIB_SITE_PACKAGES) +DBS3_PY_ROOT=$(getVariableValue \$DBS3_CLIENT_ROOT \$PYTHON_LIB_SITE_PACKAGES) +DBS3_PYCURL_ROOT=$(getVariableValue \$DBS3_PYCURL_CLIENT_ROOT \$PYTHON_LIB_SITE_PACKAGES) + +export PYTHONPATH=$PYTHONPATH:$CRAB3_PY_ROOT:$DBS3_PY_ROOT:$DBS3_PYCURL_ROOT +export PATH=$PATH:$CRAB3_BIN_ROOT +if [ -n "$BASH" ]; then + echo bash is set + source $CRAB3_ETC_ROOT/crab-bash-completion.sh +fi + +#[mmascher@lxplus007 ~]$ export CRAB_SOURCE_SCRIPT=/cvmfs/cms.cern.ch/crab3/crab_pre.sh +#[mmascher@lxplus007 ~]$ source ~/repos/CRABClient/init-light.sh +#[mmascher@lxplus007 ~]$ crab diff --git a/src/python/CRABClient/Commands/purge.py b/src/python/CRABClient/Commands/purge.py index 5c0d166ce..a9a601703 100644 --- a/src/python/CRABClient/Commands/purge.py +++ b/src/python/CRABClient/Commands/purge.py @@ -73,7 +73,7 @@ def __call__(self): except HTTPException as re: if 'X-Error-Info' in re.headers and 'Not such file' in re.headers['X-Error-Info']: self.logger.info('%sError%s: Failed to find task file in crab server cache; the file might have been already purged' % (colors.RED,colors.NORMAL)) - raise HTTPException(re) + raise if ufcresult == '': self.logger.info('%sSuccess%s: Successfully removed task files from crab server cache' % (colors.GREEN, colors.NORMAL)) diff --git a/src/python/CRABClient/Commands/submit.py b/src/python/CRABClient/Commands/submit.py index dd3647988..eefb307e1 100644 --- a/src/python/CRABClient/Commands/submit.py +++ b/src/python/CRABClient/Commands/submit.py @@ -321,7 +321,7 @@ def executeTestRun(self, filecacheurl): Runs a trial to obtain the performance report. Repeats trial with successively larger input events until a job length of maxSeconds is reached (this improves accuracy for fast-running CMSSW parameter sets.) """ - ufc = CRABClient.Emulator.getEmulator('ufc')({'endpoint' : filecacheurl}) + ufc = CRABClient.Emulator.getEmulator('ufc')({'endpoint' : filecacheurl, "pycurl": True}) cwd = os.getcwd() try: tmpDir = tempfile.mkdtemp() diff --git a/src/python/CRABClient/JobType/UserTarball.py b/src/python/CRABClient/JobType/UserTarball.py index dbf796d3a..13d78315a 100644 --- a/src/python/CRABClient/JobType/UserTarball.py +++ b/src/python/CRABClient/JobType/UserTarball.py @@ -122,7 +122,7 @@ def upload(self, filecacheurl=None): self.close() archiveName = self.tarfile.name self.logger.debug("Uploading archive %s to the CRAB cache. Using URI %s" % (archiveName, filecacheurl)) - ufc = CRABClient.Emulator.getEmulator('ufc')({'endpoint' : filecacheurl}) + ufc = CRABClient.Emulator.getEmulator('ufc')({'endpoint' : filecacheurl, "pycurl": True}) result = ufc.upload(archiveName, excludeList = USER_SANDBOX_EXCLUSIONS) if 'hashkey' not in result: self.logger.error("Failed to upload source files: %s" % str(result))