diff --git a/RucioClient.py b/RucioClient.py index 3f014a22a..5bef4888f 100755 --- a/RucioClient.py +++ b/RucioClient.py @@ -9,8 +9,11 @@ ${RUCIO_HOME}/rucio.cfg """ +import os +if not os.getenv('RUCIO_HOME'): os.environ['RUCIO_HOME']='/data/unified/WmAgentScripts/Unified/' from rucio.client import Client + class RucioClient(Client): """ A wrapper class for the Rucio client. @@ -27,7 +30,7 @@ def __init__(self, **kwargs): 'auth_host': 'https://cms-rucio-auth.cern.ch', 'auth_type': 'x509_proxy', 'ca_cert': '/etc/grid-security/certificates/', - 'account': 'unified' + 'account': 'unified' if os.getenv('USER')=='cmsunified' else os.getenv('USER') } defaultConfig.update(kwargs) diff --git a/Unified/etc/rucio.cfg b/Unified/etc/rucio.cfg new file mode 100644 index 000000000..90f13ba4c --- /dev/null +++ b/Unified/etc/rucio.cfg @@ -0,0 +1,10 @@ +[common] +[client] +rucio_host = http://cms-rucio.cern.ch +auth_host = https://cms-rucio-auth.cern.ch +auth_type = x509 +ca_cert = /etc/grid-security/certificates/ +client_cert = $X509_USER_CERT +client_key = $X509_USER_KEY +client_x509_proxy = $X509_USER_PROXY +request_retries = 3 diff --git a/credentials.sh b/credentials.sh index a1ffe5290..faee73aa0 100755 --- a/credentials.sh +++ b/credentials.sh @@ -24,4 +24,3 @@ if [ "$1" == "create" ] ; then else echo "using grid proxy" $X509_USER_PROXY fi - diff --git a/postcycle-review-manual.sh b/postcycle-review-manual.sh index 9859a2b44..c924bac3b 100755 --- a/postcycle-review-manual.sh +++ b/postcycle-review-manual.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-review-recovering.sh b/postcycle-review-recovering.sh index 742cba725..53f2374a6 100755 --- a/postcycle-review-recovering.sh +++ b/postcycle-review-recovering.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-strict.sh b/postcycle-strict.sh index af88ddd02..57cd9f466 100755 --- a/postcycle-strict.sh +++ b/postcycle-strict.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-update.sh b/postcycle-update.sh index 80ae781ef..c3cc32d48 100755 --- a/postcycle-update.sh +++ b/postcycle-update.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name