Skip to content

Commit e55fd0c

Browse files
committed
feat: Allow createJDLWithInitialStatus to store real boolean instead of strings
1 parent 624120d commit e55fd0c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ def checkAndPrepareJob(jobID, classAdJob, classAdReq, owner, ownerDN, ownerGroup
139139
return S_OK()
140140

141141

142-
def createJDLWithInitialStatus(classAdJob, classAdReq, jdl2DBParameters, jobAttrs, initialStatus, initialMinorStatus):
142+
def createJDLWithInitialStatus(
143+
classAdJob, classAdReq, jdl2DBParameters, jobAttrs, initialStatus, initialMinorStatus, *, modern=False
144+
):
145+
"""
146+
:param modern: if True, store boolean instead of string for VerifiedFlag (used by diracx only)
147+
"""
143148
priority = classAdJob.getAttributeInt("Priority")
144149
if priority is None:
145150
priority = 0
@@ -158,7 +163,7 @@ def createJDLWithInitialStatus(classAdJob, classAdReq, jdl2DBParameters, jobAttr
158163
else:
159164
jobAttrs["Site"] = jdlValue
160165

161-
jobAttrs["VerifiedFlag"] = "True"
166+
jobAttrs["VerifiedFlag"] = True if modern else "True"
162167

163168
jobAttrs["Status"] = initialStatus
164169

0 commit comments

Comments
 (0)