8
8
the DISET framework
9
9
10
10
"""
11
- # imports
12
- import six
13
-
14
11
# from DIRAC
15
12
from DIRAC import S_OK
16
13
from DIRAC .Core .DISET .RequestHandler import RequestHandler
17
14
from DIRAC .DataManagementSystem .DB .DataIntegrityDB import DataIntegrityDB
18
15
19
16
20
- class DataIntegrityHandler ( RequestHandler ) :
17
+ class DataIntegrityHandlerMixin :
21
18
"""
22
19
.. class:: DataIntegrityHandler
23
20
@@ -31,7 +28,7 @@ def initializeHandler(cls, serviceInfoDict):
31
28
cls .dataIntegrityDB = DataIntegrityDB ()
32
29
return S_OK ()
33
30
34
- types_removeProblematic = [list ( six . integer_types ) + [ list ]]
31
+ types_removeProblematic = [[ int , list ]]
35
32
36
33
def export_removeProblematic (self , fileID ):
37
34
"""Remove the file with the supplied FileID from the database"""
@@ -57,7 +54,7 @@ def export_getProblematic(self):
57
54
)
58
55
return res
59
56
60
- types_getPrognosisProblematics = [list ( six . string_types ) ]
57
+ types_getPrognosisProblematics = [str ]
61
58
62
59
def export_getPrognosisProblematics (self , prognosis ):
63
60
"""Get problematic files from the problematics table of the IntegrityDB"""
@@ -69,7 +66,7 @@ def export_getPrognosisProblematics(self, prognosis):
69
66
)
70
67
return res
71
68
72
- types_setProblematicStatus = [list ( six . integer_types ), list ( six . string_types ) ]
69
+ types_setProblematicStatus = [int , str ]
73
70
74
71
def export_setProblematicStatus (self , fileID , status ):
75
72
"""Update the status of the problematics with the provided fileID"""
@@ -79,7 +76,7 @@ def export_setProblematicStatus(self, fileID, status):
79
76
self .log .error ("DataIntegrityHandler.setProblematicStatus: Failed to set status." , res ["Message" ])
80
77
return res
81
78
82
- types_incrementProblematicRetry = [list ( six . integer_types ) ]
79
+ types_incrementProblematicRetry = [int ]
83
80
84
81
def export_incrementProblematicRetry (self , fileID ):
85
82
"""Update the retry count for supplied file ID."""
@@ -91,7 +88,7 @@ def export_incrementProblematicRetry(self, fileID):
91
88
)
92
89
return res
93
90
94
- types_insertProblematic = [list ( six . string_types ) , dict ]
91
+ types_insertProblematic = [str , dict ]
95
92
96
93
def export_insertProblematic (self , source , fileMetadata ):
97
94
"""Insert problematic files into the problematics table of the IntegrityDB"""
@@ -111,7 +108,7 @@ def export_changeProblematicPrognosis(self, fileID, newPrognosis):
111
108
self .log .error ("DataIntegrityHandler.changeProblematicPrognosis: Failed to update." , res ["Message" ])
112
109
return res
113
110
114
- types_getTransformationProblematics = [list ( six . integer_types ) ]
111
+ types_getTransformationProblematics = [int ]
115
112
116
113
def export_getTransformationProblematics (self , transID ):
117
114
"""Get the problematics for a given transformation"""
@@ -148,3 +145,7 @@ def export_getDistinctPrognosis(self):
148
145
else :
149
146
self .log .error ("DataIntegrityHandler.getDistinctPrognosis: Failed to get unique prognosis." , res ["Message" ])
150
147
return res
148
+
149
+
150
+ class DataIntegrityHandler (DataIntegrityHandlerMixin , RequestHandler ):
151
+ pass
0 commit comments