Skip to content

Commit 60b0852

Browse files
authored
Merge pull request #8521 from aldbr/fix-jobagent-cputime-int
fix: cast CPUTimeLeft as an int
2 parents c6316b5 + 4e729d3 commit 60b0852

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,9 @@ def _setCPUWorkLeft(self, cpuWorkLeft):
428428
if not result["OK"]:
429429
return self._finish(result["Message"])
430430

431-
self._updateConfiguration("CPUTimeLeft", self.cpuWorkLeft)
431+
# Store as int: consumers generally call gConfig.getValue(..., 0)
432+
# with an int default, and a float-formatted value silently coerces to 0.
433+
self._updateConfiguration("CPUTimeLeft", int(self.cpuWorkLeft))
432434
return S_OK()
433435

434436
#############################################################################

src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperUtilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class JobWrapperError(Exception):
2020

2121
def __init__(self, value):
2222
self.value = value
23-
super().__init__()
23+
super().__init__(value)
2424

2525
def __str__(self):
2626
return str(self.value)

0 commit comments

Comments
 (0)