|
24 | 24 | from DIRAC.FrameworkSystem.Client.ProxyManagerClient import gProxyManager
|
25 | 25 | from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient
|
26 | 26 | from DIRAC.WorkloadManagementSystem.Client import JobStatus
|
27 |
| -from DIRAC.WorkloadManagementSystem.Utilities.JobModel import JobDescriptionModel |
28 |
| -from DIRAC.WorkloadManagementSystem.Utilities.ParametricJob import generateParametricJobs, getParameterVectorLength |
29 |
| - |
30 | 27 | from DIRAC.WorkloadManagementSystem.Service.JobPolicy import (
|
31 | 28 | RIGHT_DELETE,
|
32 | 29 | RIGHT_KILL,
|
|
35 | 32 | RIGHT_SUBMIT,
|
36 | 33 | JobPolicy,
|
37 | 34 | )
|
| 35 | +from DIRAC.WorkloadManagementSystem.Utilities.JobModel import JobDescriptionModel |
38 | 36 | from DIRAC.WorkloadManagementSystem.Utilities.ParametricJob import generateParametricJobs, getParameterVectorLength
|
39 | 37 |
|
40 | 38 | MAX_PARAMETRIC_JOBS = 20
|
@@ -160,9 +158,9 @@ def export_submitJob(self, jobDesc):
|
160 | 158 | if nJobs > self.maxParametricJobs:
|
161 | 159 | self.log.error(
|
162 | 160 | "Maximum of parametric jobs exceeded:",
|
163 |
| - "limit %d smaller than number of jobs %d" % (self.maxParametricJobs, nJobs), |
| 161 | + f"limit {self.maxParametricJobs} smaller than number of jobs {nJobs}", |
164 | 162 | )
|
165 |
| - return S_ERROR(EWMSJDL, "Number of parametric jobs exceeds the limit of %d" % self.maxParametricJobs) |
| 163 | + return S_ERROR(EWMSJDL, f"Number of parametric jobs exceeds the limit of {self.maxParametricJobs}") |
166 | 164 | result = generateParametricJobs(jobClassAd)
|
167 | 165 | if not result["OK"]:
|
168 | 166 | return result
|
@@ -407,18 +405,18 @@ def export_removeJob(self, jobIDs):
|
407 | 405 | for jobID in validJobList:
|
408 | 406 | resultTQ = self.taskQueueDB.deleteJob(jobID)
|
409 | 407 | if not resultTQ["OK"]:
|
410 |
| - self.log.warn("Failed to remove job from TaskQueueDB", "(%d): %s" % (jobID, resultTQ["Message"])) |
| 408 | + self.log.warn("Failed to remove job from TaskQueueDB", f"({jobID}): {resultTQ['Message']}") |
411 | 409 | error_count += 1
|
412 | 410 | else:
|
413 | 411 | count += 1
|
414 | 412 |
|
415 |
| - if not (result := self.jobLoggingDB.deleteJob(validJobList))["OK"]: |
| 413 | + if not self.jobLoggingDB.deleteJob(validJobList)["OK"]: |
416 | 414 | self.log.error("Failed to remove jobs from JobLoggingDB", f"(n={len(validJobList)})")
|
417 | 415 | else:
|
418 | 416 | self.log.info("Removed jobs from JobLoggingDB", f"(n={len(validJobList)})")
|
419 | 417 |
|
420 | 418 | if count > 0 or error_count > 0:
|
421 |
| - self.log.info("Removed jobs from DB", "(%d jobs with %d errors)" % (count, error_count)) |
| 419 | + self.log.info("Removed jobs from DB", f"({count} jobs with {error_count} errors)") |
422 | 420 |
|
423 | 421 | if invalidJobList or nonauthJobList:
|
424 | 422 | self.log.error(
|
@@ -522,7 +520,7 @@ def __kill_delete_jobs(self, jobIDList, right):
|
522 | 520 | deleteJobList = []
|
523 | 521 | markKilledJobList = []
|
524 | 522 | stagingJobList = []
|
525 |
| - for jobID, sDict in result["Value"].items(): # can be an iterator |
| 523 | + for jobID, sDict in result["Value"].items(): |
526 | 524 | if sDict["Status"] in (JobStatus.RUNNING, JobStatus.MATCHED, JobStatus.STALLED):
|
527 | 525 | killJobList.append(jobID)
|
528 | 526 | elif sDict["Status"] in (
|
|
0 commit comments