diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py index aa33f2eff5a..3da50f05176 100755 --- a/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py @@ -428,7 +428,9 @@ def _setCPUWorkLeft(self, cpuWorkLeft): if not result["OK"]: return self._finish(result["Message"]) - self._updateConfiguration("CPUTimeLeft", self.cpuWorkLeft) + # Store as int: consumers generally call gConfig.getValue(..., 0) + # with an int default, and a float-formatted value silently coerces to 0. + self._updateConfiguration("CPUTimeLeft", int(self.cpuWorkLeft)) return S_OK() ############################################################################# diff --git a/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperUtilities.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperUtilities.py index e3c7f971872..947a7d0590e 100644 --- a/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperUtilities.py +++ b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperUtilities.py @@ -20,7 +20,7 @@ class JobWrapperError(Exception): def __init__(self, value): self.value = value - super().__init__() + super().__init__(value) def __str__(self): return str(self.value)