Skip to content

Commit

Permalink
Fix PreDAG.py to always use user proxy for rucio client (#7897)
Browse files Browse the repository at this point in the history
  • Loading branch information
novicecpp authored Oct 6, 2023
1 parent 412bd3a commit 264f2cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/python/RucioUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def getNativeRucioClient(config=None, logger=None):
cl = logging.getLogger('charset_normalizer')
cl.setLevel(logging.ERROR)

rucio_cert = getattr(config.Services, "Rucio_cert", config.TaskWorker.cmscert)
rucio_key = getattr(config.Services, "Rucio_key", config.TaskWorker.cmskey)
# Need to use config from `config.TaskWorker` object instead to switch to
# user cert in PreDag.py
rucio_cert = getattr(config.TaskWorker, "Rucio_cert", config.TaskWorker.cmscert)
rucio_key = getattr(config.TaskWorker, "Rucio_key", config.TaskWorker.cmskey)
logger.debug("Using cert [%s]\n and key [%s] for rucio client.", rucio_cert, rucio_key)
nativeClient = Client(
rucio_host=config.Services.Rucio_host,
Expand Down
4 changes: 4 additions & 0 deletions src/python/TaskWorker/Actions/PreDAG.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ def executeInternal(self, *args):
config.TaskWorker.cmskey = os.environ.get('X509_USER_PROXY')
config.TaskWorker.envForCMSWEB = newX509env(X509_USER_CERT=config.TaskWorker.cmscert,
X509_USER_KEY=config.TaskWorker.cmskey)
# also for talking with rucio
config.TaskWorker.Rucio_cert = os.environ.get('X509_USER_PROXY')
config.TaskWorker.Rucio_key = os.environ.get('X509_USER_PROXY')


# need to get username from classAd to setup for Rucio access
task_ad = classad.parseOne(open(os.environ['_CONDOR_JOB_AD']))
Expand Down

0 comments on commit 264f2cd

Please sign in to comment.