Skip to content

Commit 99e99ea

Browse files
committed
fix: py2->3 plus other minor fixes
1 parent 0f0f98c commit 99e99ea

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

src/DIRAC/DataManagementSystem/ConfigTemplate.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Services
6666
}
6767
}
6868

69-
# Caution: tech preview, with LHCb specific managers
69+
# Caution: LHCb specific managers
7070
TornadoFileCatalog
7171
{
7272
Protocol = https

src/DIRAC/DataManagementSystem/Service/FTS3ManagerHandler.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
:caption: FTS3Manager options
99
1010
"""
11-
import six
12-
13-
# from DIRAC
1411
from DIRAC import S_OK, S_ERROR, gLogger
1512
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getDNForUsername
1613
from DIRAC.Core.DISET.RequestHandler import RequestHandler, getServiceOption
@@ -25,7 +22,7 @@
2522
########################################################################
2623

2724

28-
class FTS3ManagerHandlerMixin(object):
25+
class FTS3ManagerHandlerMixin:
2926
"""
3027
.. class:: FTS3ManagerHandlerMixin
3128
@@ -86,7 +83,7 @@ def _isAllowed(opObj, remoteCredentials):
8683

8784
return False
8885

89-
types_persistOperation = [six.string_types]
86+
types_persistOperation = [str]
9087

9188
def export_persistOperation(self, opJSON):
9289
"""update or insert request into db
@@ -105,7 +102,7 @@ def export_persistOperation(self, opJSON):
105102

106103
return self.fts3db.persistOperation(opObj)
107104

108-
types_getOperation = [six.integer_types]
105+
types_getOperation = [int]
109106

110107
@classmethod
111108
def export_getOperation(cls, operationID):
@@ -117,14 +114,14 @@ def export_getOperation(cls, operationID):
117114
"""
118115
getOperation = cls.fts3db.getOperation(operationID)
119116
if not getOperation["OK"]:
120-
gLogger.error("getOperation: %s" % getOperation["Message"])
117+
gLogger.error("getOperation:", getOperation["Message"])
121118
return getOperation
122119

123120
getOperation = getOperation["Value"]
124121
opJSON = encode(getOperation)
125122
return S_OK(opJSON)
126123

127-
types_getActiveJobs = [six.integer_types, [type(None)] + [six.string_types], six.string_types]
124+
types_getActiveJobs = [int, [type(None)] + [str], str]
128125

129126
@classmethod
130127
def export_getActiveJobs(cls, limit, lastMonitor, jobAssignmentTag):
@@ -168,7 +165,7 @@ def export_updateJobStatus(cls, jobStatusDict):
168165
jobStatusDict = strToIntDict(jobStatusDict)
169166
return cls.fts3db.updateJobStatus(jobStatusDict)
170167

171-
types_getNonFinishedOperations = [six.integer_types, six.string_types]
168+
types_getNonFinishedOperations = [int, str]
172169

173170
@classmethod
174171
def export_getNonFinishedOperations(cls, limit, operationAssignmentTag):
@@ -188,7 +185,7 @@ def export_getNonFinishedOperations(cls, limit, operationAssignmentTag):
188185

189186
return S_OK(nonFinishedOperationsJSON)
190187

191-
types_getOperationsFromRMSOpID = [six.integer_types]
188+
types_getOperationsFromRMSOpID = [int]
192189

193190
@classmethod
194191
def export_getOperationsFromRMSOpID(cls, rmsOpID):
@@ -200,7 +197,7 @@ def export_getOperationsFromRMSOpID(cls, rmsOpID):
200197
"""
201198
res = cls.fts3db.getOperationsFromRMSOpID(rmsOpID)
202199
if not res["OK"]:
203-
gLogger.error("getOperationsFromRMSOpID: %s" % res["Message"])
200+
gLogger.error("getOperationsFromRMSOpID", res["Message"])
204201
return res
205202

206203
operations = res["Value"]

src/DIRAC/DataManagementSystem/Service/FileCatalogHandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from DIRAC.DataManagementSystem.DB.FileCatalogDB import FileCatalogDB
1414

1515

16-
class FileCatalogHandlerMixin(object):
16+
class FileCatalogHandlerMixin:
1717
"""
1818
A simple Replica and Metadata Catalog service.
1919
"""

src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import errno
1515

1616
# from DIRAC
17-
import six
1817
from DIRAC import S_OK, S_ERROR, gLogger
1918

2019
from DIRAC.Core.DISET.RequestHandler import RequestHandler
@@ -93,7 +92,7 @@ def _hasAccess(self, lfn, s3_method):
9392

9493
return returnSingleResult(self._fc.hasAccess(lfn, opType))
9594

96-
types_createPresignedUrl = [six.string_types, six.string_types, (dict, list), six.integer_types]
95+
types_createPresignedUrl = [str, str, (dict, list), int]
9796

9897
def export_createPresignedUrl(self, storageName, s3_method, urls, expiration):
9998
"""Generate a presigned URL for a given object, given method, and given storage

src/DIRAC/DataManagementSystem/Service/StorageElementHandler.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import re
2929
import errno
3030
import shlex
31-
import six
3231

3332
# from DIRAC
3433
from DIRAC import gLogger, S_OK, S_ERROR
@@ -226,15 +225,15 @@ def __getFileStat(path):
226225

227226
return S_OK(resultDict)
228227

229-
types_exists = [six.string_types]
228+
types_exists = [str]
230229

231230
def export_exists(self, fileID):
232231
"""Check existence of the fileID"""
233232
if os.path.exists(self.__resolveFileID(fileID)):
234233
return S_OK(True)
235234
return S_OK(False)
236235

237-
types_getMetadata = [six.string_types]
236+
types_getMetadata = [str]
238237

239238
def export_getMetadata(self, fileID):
240239
"""Get metadata for the file or directory specified by fileID"""
@@ -260,7 +259,7 @@ def export_getTotalDiskSpace():
260259
"""
261260
return getTotalDiskSpace()
262261

263-
types_createDirectory = [six.string_types]
262+
types_createDirectory = [str]
264263

265264
def export_createDirectory(self, dir_path):
266265
"""Creates the directory on the storage"""
@@ -282,7 +281,7 @@ def export_createDirectory(self, dir_path):
282281
gLogger.error("StorageElementHandler.createDirectory: %s" % errStr, repr(x))
283282
return S_ERROR(errStr)
284283

285-
types_listDirectory = [six.string_types, six.string_types]
284+
types_listDirectory = [str, str]
286285

287286
def export_listDirectory(self, dir_path, mode):
288287
"""Return the dir_path directory listing"""
@@ -419,7 +418,7 @@ def transfer_bulkToClient(self, fileId, token, fileHelper):
419418
gLogger.error("Failed to send bulk to network", res["Message"])
420419
return res
421420

422-
types_remove = [six.string_types, six.string_types]
421+
types_remove = [str, str]
423422

424423
def export_remove(self, fileID, token):
425424
"""Remove fileID from the storage. token is used for access rights confirmation."""
@@ -440,7 +439,7 @@ def __removeFile(self, fileID, token):
440439
else:
441440
return S_ERROR("File removal %s not authorized" % fileID)
442441

443-
types_getDirectorySize = [six.string_types]
442+
types_getDirectorySize = [str]
444443

445444
def export_getDirectorySize(self, fileID):
446445
"""Get the size occupied by the given directory"""
@@ -455,7 +454,7 @@ def export_getDirectorySize(self, fileID):
455454
else:
456455
return S_ERROR("Directory does not exists")
457456

458-
types_removeDirectory = [six.string_types, six.string_types]
457+
types_removeDirectory = [str, str]
459458

460459
def export_removeDirectory(self, fileID, token):
461460
"""Remove the given directory from the storage"""
@@ -475,7 +474,7 @@ def export_removeDirectory(self, fileID, token):
475474
gLogger.error(str(error))
476475
return S_ERROR("Failed to remove directory %s" % dir_path)
477476

478-
types_removeFileList = [list, six.string_types]
477+
types_removeFileList = [list, str]
479478

480479
def export_removeFileList(self, fileList, token):
481480
"""Remove files in the given list"""

0 commit comments

Comments
 (0)