Skip to content

Commit

Permalink
fix (TS): use TransformationStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
arrabito committed Aug 22, 2024
1 parent 9648934 commit 79c631b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/DIRAC/TransformationSystem/DB/TransformationDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Base.DB import DB
from DIRAC.Core.Utilities.DErrno import cmpError
from DIRAC.TransformationSystem.Client import TransformationStatus
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from DIRAC.Core.Security.ProxyInfo import getProxyInfo
from DIRAC.Core.Utilities.List import stringListToString, intListToString, breakListIntoChunks
Expand Down Expand Up @@ -1629,12 +1630,11 @@ def addFile(self, fileDicts, force=False, connection=False):
fileIDs = []
for fileDict in res["Value"]:
fileIDs.append(fileDict["FileID"])
if fileDict["Status"] == "Deleted":
res = self.__setTransformationFileStatus(list(fileIDs), "Unused", connection=connection)
if fileDict["Status"] == TransformationStatus.DELETED:
res = self.__setTransformationFileStatus(list(fileIDs), TransformationStatus.UNUSED, connection=connection)
if not res["OK"]:
return res
res = self.__setDataFileStatus(list(fileIDs), "New", connection=connection)
if not res["OK"]:
if not (res := self.__setDataFileStatus(list(fileIDs), TransformationStatus.NEW, connection=connection)["OK"]:
return res

res = self.addFilesToTransformation(transID, lfns)
Expand Down Expand Up @@ -1776,11 +1776,11 @@ def setMetadata(self, path, usermetadatadict, connection=False):
fileIDs = []
for fileDict in res["Value"]:
fileIDs.append(fileDict["FileID"])
if fileDict["Status"] == "Deleted":
res = self.__setTransformationFileStatus(list(fileIDs), "Unused", connection=connection)
if fileDict["Status"] == TransformationStatus.DELETED:
res = self.__setTransformationFileStatus(list(fileIDs), TransformationStatus.UNUSED, connection=connection)
if not res["OK"]:
return res
res = self.__setDataFileStatus(list(fileIDs), "New", connection=connection)
res = self.__setDataFileStatus(list(fileIDs), TransformationStatus.NEW, connection=connection)
if not res["OK"]:
return res

Expand Down

0 comments on commit 79c631b

Please sign in to comment.