@@ -103,8 +103,6 @@ def _getAllowedJobTypes(self):
103
103
def execute (self ):
104
104
"""Remove or delete jobs in various status"""
105
105
106
- # TODO: check the WMS SM before calling the functions below (v7r3)
107
-
108
106
# First, fully remove jobs in JobStatus.DELETED state
109
107
result = self .removeDeletedJobs ()
110
108
if not result ["OK" ]:
@@ -143,14 +141,13 @@ def execute(self):
143
141
144
142
return S_OK ()
145
143
146
- def removeDeletedJobs (self , delay = False ):
144
+ def removeDeletedJobs (self ):
147
145
"""Fully remove jobs that are already in status "DELETED", unless there are still requests.
148
146
149
- :param int delay: days of delay
150
147
:returns: S_OK/S_ERROR
151
148
"""
152
149
153
- res = self ._getJobsList ({"Status" : JobStatus .DELETED }, delay )
150
+ res = self ._getJobsList ({"Status" : JobStatus .DELETED })
154
151
if not res ["OK" ]:
155
152
return res
156
153
jobList = res ["Value" ]
@@ -270,7 +267,7 @@ def _getJobsList(self, condDict, delay=None):
270
267
:returns: S_OK with jobsList
271
268
"""
272
269
jobIDsS = set ()
273
- delayStr = "and older than %s day(s) " % delay if delay else ""
270
+ delayStr = "and older than %s" % delay if delay else ""
274
271
self .log .info ("Get jobs with %s %s" % (str (condDict ), delayStr ))
275
272
for order in ["JobID:ASC" , "JobID:DESC" ]:
276
273
result = self .jobDB .selectJobs (condDict , older = delay , orderAttribute = order , limit = self .maxJobsAtOnce )
@@ -282,8 +279,9 @@ def _getJobsList(self, condDict, delay=None):
282
279
283
280
def _getOwnerJobsDict (self , jobList ):
284
281
"""
285
- gets in input a list of int(JobID) and return a dict with a grouping of them by owner, e.g.
286
- {'dn;group': [1, 3, 4], 'dn;group_1': [5], 'dn_1;group': [2]}
282
+ :param list jobList: list of int(JobID)
283
+
284
+ :returns: a dict with a grouping of them by owner, e.g.{'dn;group': [1, 3, 4], 'dn;group_1': [5], 'dn_1;group': [2]}
287
285
"""
288
286
res = self .jobDB .getJobsAttributes (jobList , ["OwnerDN" , "OwnerGroup" ])
289
287
if not res ["OK" ]:
0 commit comments