Skip to content

Commit

Permalink
Merge pull request #7213 from aldbr/v8.1_REMOVE_owner-dn-refs-in-site…
Browse files Browse the repository at this point in the history
…director

[8.1] hackathon fixes
  • Loading branch information
fstagni authored Sep 25, 2023
2 parents a83d5bf + aa2b2b6 commit 4a3efe8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
11 changes: 1 addition & 10 deletions src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
2 changes: 1 addition & 1 deletion src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 4a3efe8

Please sign in to comment.