Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions release.notes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

*TransformationSystem

NEW: (#7170)
Implement a finer grained permissions model for Transformations.
NEW: (#7170) Implement a finer grained permissions model for Transformations.

*DataManagementSystem

Expand Down
16 changes: 0 additions & 16 deletions src/DIRAC/Interfaces/API/DiracAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,6 @@ def getVOMSProxy(self, userDN, userGroup, vomsAttr=False, validity=43200, limite
userDN, userGroup, limited=limited, requiredVOMSAttribute=vomsAttr, requiredTimeLeft=validity
)

#############################################################################
def getPilotProxy(self, userDN, userGroup, validity=43200):
"""Retrieves a pilot proxy with default 12hr validity and stores
this in a file in the local directory by default.

Example usage:

>>> gLogger.notice(diracAdmin.getVOMSProxy())
{'OK': True, 'Value': }

:return: S_OK,S_ERROR

"""

return gProxyManager.getPilotProxyFromDIRACGroup(userDN, userGroup, requiredTimeLeft=validity)

#############################################################################
def resetJob(self, jobID):
"""Reset a job or list of jobs in the WMS. This operation resets the reschedule
Expand Down
15 changes: 2 additions & 13 deletions src/DIRAC/Interfaces/scripts/dirac_admin_get_job_pilots.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
#!/usr/bin/env python
########################################################################
# File : dirac-admin-get-job-pilots
# Author : Stuart Paterson
########################################################################
"""
Retrieve info about pilots that have matched a given Job

Example:
$ dirac-admin-get-job-pilots 1848
{'https://marlb.in2p3.fr:9000/bqYViq6KrVgGfr6wwgT45Q': {'AccountingSent': 'False',
'BenchMark': 8.1799999999999997,
'Broker': 'marwms.in2p3.fr',
'DestinationSite': 'lpsc-ce.in2p3.fr',
'GridSite': 'LCG.LPSC.fr',
'GridType': 'gLite',
'Jobs': [1848L],
'LastUpdateTime': datetime.datetime(2011, 2, 21, 12, 39, 10),
'OutputReady': 'True',
'OwnerDN': '/O=GRID/C=FR/O=CNRS/OU=LPC/CN=Sebastien Guizard',
'OwnerGroup': '/biomed',
'ParentID': 0L,
'PilotID': 2247L,
'PilotJobReference': 'https://marlb.in2p3.fr:9000/biq6KT45Q',
'PilotStamp': '',
'Status': 'Done',
'SubmissionTime': datetime.datetime(2011, 2, 21, 12, 27, 52),
'TaskQueueID': 399L}}
"""
# pylint: disable=wrong-import-position
from DIRAC.Core.Base.Script import Script


@Script()
def main():
# Registering arguments will automatically add their description to the help menu
Script.registerArgument(["JobID: DIRAC ID of the Job"])
# parseCommandLine show help when mandatory arguments are not specified or incorrect argument
_, args = Script.parseCommandLine(ignoreErrors=True)

from DIRAC import exit as DIRACExit
Expand All @@ -58,8 +47,8 @@ def main():
errorList.append((job, result["Message"]))
exitCode = 2

for error in errorList:
print("ERROR %s: %s" % error)
for job, error in errorList:
print(f"ERROR for {job}: {error}")

DIRACExit(exitCode)

Expand Down
17 changes: 3 additions & 14 deletions src/DIRAC/Interfaces/scripts/dirac_admin_get_pilot_info.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
#!/usr/bin/env python
########################################################################
# File : dirac-admin-get-pilot-info
# Author : Ricardo Graciani
########################################################################
"""
Retrieve available info about the given pilot

Example:
$ dirac-admin-get-pilot-info https://marlb.in2p3.fr:9000/26KCLKBFtxXKHF4_ZrQjkw
{'https://marlb.in2p3.fr:9000/26KCLKBFtxXKHF4_ZrQjkw': {'AccountingSent': 'False',
'BenchMark': 0.0,
'Broker': 'marwms.in2p3.fr',
'DestinationSite': 'cclcgceli01.in2p3.fr',
'GridSite': 'LCG.IN2P3.fr',
'GridType': 'gLite',
'LastUpdateTime': datetime.datetime(2011, 2, 21, 12, 49, 14),
'OutputReady': 'False',
'OwnerDN': '/O=GRID/C=FR/O=CNRS/OU=LPC/CN=Sebastien Guizard',
'OwnerGroup': '/biomed',
'ParentID': 0L,
'PilotID': 2241L,
'PilotJobReference': 'https://marlb.in2p3.fr:9000/2KHFrQjkw',
'PilotStamp': '',
'Status': 'Done',
'SubmissionTime': datetime.datetime(2011, 2, 21, 12, 27, 52),
'TaskQueueID': 399L}}
"""
# pylint: disable=wrong-import-position
from DIRAC.Core.Base.Script import Script

extendedPrint = False
Expand Down Expand Up @@ -63,7 +54,6 @@ def main():
for key in [
"PilotJobReference",
"Status",
"OwnerDN",
"OwnerGroup",
"SubmissionTime",
"DestinationSite",
Expand All @@ -85,10 +75,9 @@ def main():
diracAdmin.log.notice(f"{tab}Job ID: {jobID}")
tab += " "
for key in [
"OwnerDN",
"OwnerGroup",
"JobName",
"Status",
"OwnerGroup",
"StartExecTime",
"LastUpdateTime",
"EndExecTime",
Expand All @@ -99,8 +88,8 @@ def main():
else:
print(diracAdmin.pPrint.pformat({gridID: res}))

for error in errorList:
print("ERROR %s: %s" % error)
for job, error in errorList:
print(f"ERROR for {job}: {error}")

DIRACExit(exitCode)

Expand Down
4 changes: 2 additions & 2 deletions src/DIRAC/ResourceStatusSystem/Command/PilotCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def doNew(self, masterParams=None):
return S_ERROR(f'"{element}" is not Site nor Resource')

if element == "Resource":
pilotsResultPivot = self.pilots.getGroupedPilotSummary({}, ["GridSite", "DestinationSite", "OwnerGroup"])
pilotsResultPivot = self.pilots.getGroupedPilotSummary(["GridSite", "DestinationSite", "OwnerGroup"])
elif element == "Site":
pilotsResultPivot = self.pilots.getGroupedPilotSummary({}, ["GridSite", "OwnerGroup"])
pilotsResultPivot = self.pilots.getGroupedPilotSummary(["GridSite", "OwnerGroup"])
else:
# You should never see this error
return S_ERROR(f'"{element}" is not Site nor Resource')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _addPilotsAccountingReport(self, pilotsData):
pA.setValueByKey("Site", "Unknown")
pA.setValueByKey("GridCE", pData["DestinationSite"])
pA.setValueByKey("GridMiddleware", pData["GridType"])
pA.setValueByKey("GridResourceBroker", pData["Broker"])
pA.setValueByKey("GridResourceBroker", "DIRAC")
pA.setValueByKey("GridStatus", pData["Status"])
if "Jobs" not in pData:
pA.setValueByKey("Jobs", 0)
Expand Down
4 changes: 1 addition & 3 deletions src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,6 @@ def _addPilotTQReference(self, queue, taskQueueDict, pilotList, stampDict):
result = self.pilotAgentsDB.addPilotTQReference(
pilotsList,
tqID,
self.pilotDN,
self.pilotGroup,
self.localhost,
self.queueDict[queue]["CEType"],
Expand Down Expand Up @@ -1201,7 +1200,6 @@ def _updatePilotStatusPerQueue(self, queue, proxy):
"GridType": ceType,
"GridSite": siteName,
"Status": PilotStatus.PILOT_TRANSIENT_STATES,
"OwnerDN": self.pilotDN,
"OwnerGroup": self.pilotGroup,
}
)
Expand Down Expand Up @@ -1356,7 +1354,7 @@ def sendPilotAccounting(self, pilotDict):
pA.setValueByKey("Site", "Unknown")
pA.setValueByKey("GridCE", pilotDict[pRef]["DestinationSite"])
pA.setValueByKey("GridMiddleware", pilotDict[pRef]["GridType"])
pA.setValueByKey("GridResourceBroker", pilotDict[pRef]["Broker"])
pA.setValueByKey("GridResourceBroker", "DIRAC")
pA.setValueByKey("GridStatus", pilotDict[pRef]["Status"])
if "Jobs" not in pilotDict[pRef]:
pA.setValueByKey("Jobs", 0)
Expand Down
Loading