Skip to content

Commit

Permalink
fix: JobAgent.setupProxy takes owner instead of ownerDN
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Feb 28, 2024
1 parent 222f951 commit 71a2d2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ def execute(self):
)

self.jobs[jobID]["JobReport"].setJobStatus(minorStatus="Job Received by Agent", sendFlag=False)
ownerDN = getDNForUsername(owner)["Value"][0]
result_setupProxy = self._setupProxy(ownerDN, jobGroup)
result_setupProxy = self._setupProxy(owner, jobGroup)
if not result_setupProxy["OK"]:
result = self._rescheduleFailedJob(jobID, result_setupProxy["Message"])
return self._finish(result["Message"], self.stopOnApplicationFailure)
Expand Down Expand Up @@ -465,10 +464,11 @@ def _updateConfiguration(self, key, value, path="/LocalSite"):
localCfg.writeToFile(localConfigFile)

#############################################################################
def _setupProxy(self, ownerDN, ownerGroup):
def _setupProxy(self, owner, ownerGroup):
"""
Retrieve a proxy for the execution of the job
"""
ownerDN = getDNForUsername(owner)["Value"][0]
if gConfig.getValue("/DIRAC/Security/UseServerCertificate", False):
proxyResult = self._requestProxyFromProxyManager(ownerDN, ownerGroup)
if not proxyResult["OK"]:
Expand Down
9 changes: 2 additions & 7 deletions src/DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ def execute(self):
if not result["OK"]:
return result
proxy = result["Value"]
result = proxy.getRemainingSecs() # pylint: disable=no-member
if not result["OK"]:
return result
lifetime_secs = result["Value"]
ce.setProxy(proxy, lifetime_secs)
ce.setProxy(proxy)

# Check that there is enough slots in the remote CE to match a job
result = self._checkCEAvailability(ce)
Expand Down Expand Up @@ -232,8 +228,7 @@ def execute(self):
)

# Setup proxy
ownerDN = getDNForUsername(owner)["Value"]
result_setupProxy = self._setupProxy(ownerDN, jobGroup)
result_setupProxy = self._setupProxy(owner, jobGroup)
if not result_setupProxy["OK"]:
result = self._rescheduleFailedJob(jobID, result_setupProxy["Message"])
self.failedQueues[queueName] += 1
Expand Down

0 comments on commit 71a2d2b

Please sign in to comment.