Skip to content

Commit 95d024e

Browse files
committed
fix: removed py2 compatibility
1 parent d9a3a0c commit 95d024e

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

src/DIRAC/MonitoringSystem/Client/MonitoringReporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from DIRAC.ConfigurationSystem.Client.Config import gConfig
2828

2929

30-
class MonitoringReporter(object):
30+
class MonitoringReporter:
3131

3232
"""
3333
.. class:: MonitoringReporter

src/DIRAC/MonitoringSystem/Client/Types/BaseType.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
########################################################################
55

66

7-
class BaseType(object):
7+
class BaseType:
88

99
"""
1010
.. class:: BaseType

src/DIRAC/MonitoringSystem/Service/MonitoringHandler.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"""
1313
import datetime
1414
import os
15-
import six
1615

1716
from DIRAC import gLogger, S_OK, S_ERROR, gConfig
1817
from DIRAC.Core.DISET.RequestHandler import RequestHandler
@@ -37,12 +36,12 @@ class MonitoringHandler(RequestHandler):
3736
"""
3837

3938
__reportRequestDict = {
40-
"typeName": six.string_types,
41-
"reportName": six.string_types,
39+
"typeName": str,
40+
"reportName": str,
4241
"startTime": Time._allDateTypes,
4342
"endTime": Time._allDateTypes,
4443
"condDict": dict,
45-
"grouping": six.string_types,
44+
"grouping": str,
4645
"extraArgs": dict,
4746
}
4847

@@ -73,7 +72,7 @@ def initializeHandler(cls, serviceInfo):
7372

7473
return S_OK()
7574

76-
types_listUniqueKeyValues = [six.string_types]
75+
types_listUniqueKeyValues = [str]
7776

7877
def export_listUniqueKeyValues(self, typeName):
7978
"""
@@ -87,7 +86,7 @@ def export_listUniqueKeyValues(self, typeName):
8786
# NOTE: we can apply some policies if it will be needed!
8887
return self.__db.getKeyValues(typeName)
8988

90-
types_listReports = [six.string_types]
89+
types_listReports = [str]
9190

9291
def export_listReports(self, typeName):
9392
"""
@@ -257,7 +256,7 @@ def export_getReport(self, reportRequest):
257256
reportRequest["generatePlot"] = False
258257
return reporter.generate(reportRequest, self.getRemoteCredentials())
259258

260-
types_addMonitoringRecords = [six.string_types, list]
259+
types_addMonitoringRecords = [str, list]
261260

262261
def export_addMonitoringRecords(self, monitoringtype, data):
263262
"""
@@ -275,7 +274,7 @@ def export_addMonitoringRecords(self, monitoringtype, data):
275274
gLogger.debug("addMonitoringRecords:", prefix)
276275
return self.__db.bulk_index(prefix, data)
277276

278-
types_addRecords = [six.string_types, six.string_types, list]
277+
types_addRecords = [str, str, list]
279278

280279
def export_addRecords(self, indexname, monitoringType, data):
281280
"""
@@ -293,7 +292,7 @@ def export_addRecords(self, indexname, monitoringType, data):
293292
gLogger.debug("Mapping:", mapping)
294293
return self.__db.bulk_index(indexname, data, mapping)
295294

296-
types_deleteIndex = [six.string_types]
295+
types_deleteIndex = [str]
297296

298297
def export_deleteIndex(self, indexName):
299298
"""
@@ -307,7 +306,7 @@ def export_deleteIndex(self, indexName):
307306
gLogger.debug("delete index:", indexName)
308307
return self.__db.deleteIndex(indexName)
309308

310-
types_getLastDayData = [six.string_types, dict]
309+
types_getLastDayData = [str, dict]
311310

312311
def export_getLastDayData(self, typeName, condDict):
313312
"""
@@ -322,7 +321,7 @@ def export_getLastDayData(self, typeName, condDict):
322321

323322
return self.__db.getLastDayData(typeName, condDict)
324323

325-
types_getLimitedDat = [six.string_types, dict, int]
324+
types_getLimitedDat = [str, dict, int]
326325

327326
def export_getLimitedData(self, typeName, condDict, size):
328327
"""
@@ -339,7 +338,7 @@ def export_getLimitedData(self, typeName, condDict, size):
339338
"""
340339
return self.__db.getLimitedData(typeName, condDict, size)
341340

342-
types_getDataForAGivenPeriod = [six.string_types, dict, six.string_types, six.string_types]
341+
types_getDataForAGivenPeriod = [str, dict, str, str]
343342

344343
def export_getDataForAGivenPeriod(self, typeName, condDict, initialDate="", endDate=""):
345344
"""
@@ -358,7 +357,7 @@ def export_getDataForAGivenPeriod(self, typeName, condDict, initialDate="", endD
358357
"""
359358
return self.__db.getDataForAGivenPeriod(typeName, condDict, initialDate, endDate)
360359

361-
types_put = [list, six.string_types]
360+
types_put = [list, str]
362361

363362
def export_put(self, recordsToInsert, monitoringType):
364363
"""

src/DIRAC/MonitoringSystem/private/DBUtils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _convertToSeconds(interval):
2020
raise ValueError("Invalid time interval '%s'" % interval)
2121

2222

23-
class DBUtils(object):
23+
class DBUtils:
2424

2525
"""
2626
.. class:: DBUtils

src/DIRAC/MonitoringSystem/private/MainReporter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from DIRAC.Core.Utilities.ObjectLoader import loadObjects
1111

1212

13-
class PlottersList(object):
13+
class PlottersList:
1414

1515
"""
1616
Used to determine all available plotters used to create the plots
@@ -41,9 +41,8 @@ def getPlotterClass(self, typeName):
4141
return S_ERROR()
4242

4343

44-
class MainReporter(object):
44+
class MainReporter:
4545
"""
46-
:param object __db: database object
4746
:param str __setup: DIRAC setup
4847
:param str __csSection: CS section used to configure some parameters.
4948
:param list __plotterList: available plotters

0 commit comments

Comments
 (0)