diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py index af84b7bb986..3ad47ffca97 100755 --- a/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py @@ -254,7 +254,7 @@ def execute(self): ) self.jobReport.setJobStatus(minorStatus="Job Received by Agent", sendFlag=False) - ownerDN = getDNForUsername(owner)["Value"] + ownerDN = getDNForUsername(owner)["Value"][0] result_setupProxy = self._setupProxy(ownerDN, jobGroup) if not result_setupProxy["OK"]: result = self._rescheduleFailedJob(jobID, result_setupProxy["Message"]) diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py index b77e29ed703..0780e43d7ca 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py @@ -190,16 +190,7 @@ def _addPilotsAccountingReport(self, pilotsData): pA = PilotAccounting() pA.setEndTime(pData["LastUpdateTime"]) pA.setStartTime(pData["SubmissionTime"]) - retVal = Registry.getUsernameForDN(pData["OwnerDN"]) - if not retVal["OK"]: - userName = "unknown" - self.log.error( - "Can't determine username for dn", - f": {pData['OwnerDN']} : {retVal['Message']}", - ) - else: - userName = retVal["Value"] - pA.setValueByKey("User", userName) + pA.setValueByKey("User", "unknown") pA.setValueByKey("UserGroup", pData["OwnerGroup"]) result = getCESiteMapping(pData["DestinationSite"]) if result["OK"] and pData["DestinationSite"] in result["Value"]: diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py index 4eb046554d5..6554ceb540a 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py @@ -1338,7 +1338,7 @@ def sendPilotAccounting(self, pilotDict): pA = PilotAccounting() pA.setEndTime(pilotDict[pRef]["LastUpdateTime"]) pA.setStartTime(pilotDict[pRef]["SubmissionTime"]) - retVal = Registry.getUsernameForDN(pilotDict[pRef]["OwnerDN"]) + retVal = Registry.getUsernameForDN(self.pilotDN) if not retVal["OK"]: username = "unknown" self.log.error("Can't determine username for dn", pilotDict[pRef]["OwnerDN"])