From 3b4a236f532804fc2db420bfbe61365344c445c3 Mon Sep 17 00:00:00 2001 From: sharad1126 Date: Tue, 7 Jul 2020 16:49:02 +0200 Subject: [PATCH] change eos cp and eos mkdir as per eosteam --- cWrap.sh | 14 +++++++------- utils.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cWrap.sh b/cWrap.sh index 52079dc07..f315d126b 100755 --- a/cWrap.sh +++ b/cWrap.sh @@ -11,7 +11,7 @@ cd $BASE_DIR modulename=`echo $1 | sed 's/\.py//' | sed 's/Unified\///'` mkdir -p $HTML_DIR/logs/$modulename/ -eos mkdir -p $FINAL_HTML_DIR/logs/$modulename/ +env EOS_MGM_URL=root://eoscms.cern.ch eos mkdir -p $FINAL_HTML_DIR/logs/$modulename/ last_log=$HTML_DIR/logs/$modulename/last.log s_dated_log=$modulename/`date +%F_%T`.log @@ -24,15 +24,15 @@ echo $$ >> $log if [ -r unified_drain ] ; then echo "System is locally draining" >> $log cp $log $last_log - eos cp $log $FINAL_HTML_DIR/logs/$modulename/. - eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log + env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/. + env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log exit fi if [ -r /eos/cms/store/unified/unified_drain ] ; then echo "System is globally draining" >> $log cp $log $last_log - eos cp $log $FINAL_HTML_DIR/logs/$modulename/. - eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log + env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/. + env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log exit fi @@ -74,7 +74,7 @@ echo `date` >> $log #cp $log $dated_log cp $log $last_log -eos cp $log $FINAL_HTML_DIR/logs/$modulename/. -eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log +env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/. +env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log #rm $log diff --git a/utils.py b/utils.py index c177ec12d..8d74d0e15 100755 --- a/utils.py +++ b/utils.py @@ -1237,7 +1237,7 @@ def close(self): try: print "moving",self.cache_filename,"to",self.eos_filename print("Attempt {}".format(T)) - r = os.system("eoscp %s %s"%( self.cache_filename, self.eos_filename)) + r = os.system("env EOS_MGM_URL=root://eoscms.cern.ch eos cp %s %s"%( self.cache_filename, self.eos_filename)) if r==0 and os.path.getsize(self.eos_filename) > 0: return True print "not able to copy to eos",self.eos_filename,"with code",r time.sleep(30) @@ -3028,7 +3028,7 @@ def save(self): ## write the information out to disk new_base_eos_dir = 'root://eoscms.cern.ch/'+base_eos_dir - os.system('eoscp %s/closedout.json %s/closedout.json.last'%(new_base_eos_dir, new_base_eos_dir)) + os.system('env EOS_MGM_URL=root://eoscms.cern.ch eos cp %s/closedout.json %s/closedout.json.last'%(new_base_eos_dir, new_base_eos_dir)) ## merge the content try: