Skip to content

Commit 5d2a96b

Browse files
committed
fix: CEs should not submit pilots with a DiracX token
1 parent 0efa45e commit 5d2a96b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/DIRAC/FrameworkSystem/Client/ProxyManagerClient.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def getPayloadProxyFromDIRACGroup(self, userDN, userGroup, requiredTimeLeft, pro
418418
proxyToConnect=proxyToConnect,
419419
)
420420

421-
def dumpProxyToFile(self, chain, destinationFile=None, requiredTimeLeft=600):
421+
def dumpProxyToFile(self, chain, destinationFile=None, requiredTimeLeft=600, includeToken=True):
422422
"""Dump a proxy to a file. It's cached so multiple calls won't generate extra files
423423
424424
:param X509Chain chain: proxy as a chain
@@ -442,7 +442,10 @@ def dumpProxyToFile(self, chain, destinationFile=None, requiredTimeLeft=600):
442442
filename = retVal["Value"]
443443
if not (result := chain.getDIRACGroup())["OK"]:
444444
return result
445-
if not (result := addTokenToPEM(filename, result["Value"]))["OK"]: # pylint: disable=unsubscriptable-object
445+
if (
446+
includeToken
447+
and not (result := addTokenToPEM(filename, result["Value"]))["OK"] # pylint: disable=unsubscriptable-object
448+
):
446449
return result
447450
self.__filesCache.add(cHash, chain.getRemainingSecs()["Value"], filename)
448451
return S_OK(filename)

src/DIRAC/Resources/Computing/ComputingElement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def setToken(self, token):
105105
def _prepareProxy(self):
106106
"""Set the environment variable X509_USER_PROXY"""
107107
if self.proxy:
108-
result = gProxyManager.dumpProxyToFile(self.proxy, requiredTimeLeft=self.minProxyTime)
108+
result = gProxyManager.dumpProxyToFile(self.proxy, requiredTimeLeft=self.minProxyTime, includeToken=False)
109109
if not result["OK"]:
110110
return result
111111
os.environ["X509_USER_PROXY"] = result["Value"]

0 commit comments

Comments
 (0)