From 07f71f8a3176649e88f8c63b71a3229ae4607e94 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Wed, 22 May 2024 12:41:13 +0200 Subject: [PATCH] style: mostly imports fixes --- .../Client/JobMonitoringClient.py | 1 - .../WorkloadManagementSystem/DB/JobDBUtils.py | 13 +++---------- .../WorkloadManagementSystem/DB/JobLoggingDB.py | 5 ++--- .../WorkloadManagementSystem/Executor/InputData.py | 12 ++++++------ .../Executor/JobScheduling.py | 14 ++++++-------- 5 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py b/src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py index 3c967b1be6b..e899c0154d1 100755 --- a/src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py @@ -1,6 +1,5 @@ """ Class that contains client access to the job monitoring handler. """ -import os from DIRAC.Core.Base.Client import Client, createClient from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning from DIRAC.Core.Utilities.JEncode import strToIntDict diff --git a/src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py b/src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py index 8148f0a8606..89e4c95338b 100644 --- a/src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py +++ b/src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py @@ -4,18 +4,11 @@ import zlib from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations - - -from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR -from DIRAC.Core.Utilities.DErrno import EWMSSUBM, EWMSJMAN +from DIRAC.Core.Utilities.DErrno import EWMSSUBM from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader - -from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest +from DIRAC.Core.Utilities.ReturnValues import S_ERROR, S_OK, returnValueOrRaise from DIRAC.WorkloadManagementSystem.Client import JobStatus - - -from DIRAC.Core.Utilities.ReturnValues import returnValueOrRaise - +from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest getDIRACPlatform = returnValueOrRaise( ObjectLoader().loadObject("ConfigurationSystem.Client.Helpers.Resources", "getDIRACPlatform") diff --git a/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py b/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py index 51fd0092e25..bf813a3803c 100755 --- a/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py +++ b/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py @@ -7,11 +7,10 @@ getWMSTimeStamps() """ import datetime -import time -from DIRAC import S_OK, S_ERROR -from DIRAC.Core.Utilities import TimeUtilities +from DIRAC import S_ERROR, S_OK from DIRAC.Core.Base.DB import DB +from DIRAC.Core.Utilities import TimeUtilities MAGIC_EPOC_NUMBER = 1270000000 diff --git a/src/DIRAC/WorkloadManagementSystem/Executor/InputData.py b/src/DIRAC/WorkloadManagementSystem/Executor/InputData.py index 9c7e4454a4e..80f114a1715 100755 --- a/src/DIRAC/WorkloadManagementSystem/Executor/InputData.py +++ b/src/DIRAC/WorkloadManagementSystem/Executor/InputData.py @@ -5,15 +5,15 @@ import pprint import time -from DIRAC import S_OK, S_ERROR -from DIRAC.Core.Utilities.Proxy import executeWithUserProxy +from DIRAC import S_ERROR, S_OK from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations -from DIRAC.Resources.Storage.StorageElement import StorageElement -from DIRAC.Resources.Catalog.FileCatalog import FileCatalog -from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers +from DIRAC.Core.Utilities.Proxy import executeWithUserProxy from DIRAC.DataManagementSystem.Client.DataManager import DataManager -from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor +from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers +from DIRAC.Resources.Catalog.FileCatalog import FileCatalog +from DIRAC.Resources.Storage.StorageElement import StorageElement from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus +from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor class InputData(OptimizerExecutor): diff --git a/src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py b/src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py index 16b520c3885..aebaef26a6a 100755 --- a/src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py +++ b/src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py @@ -11,22 +11,20 @@ import random -from DIRAC import S_OK, S_ERROR, gConfig - -from DIRAC.Core.Utilities.SiteSEMapping import getSEsForSite -from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch -from DIRAC.Core.Security import Properties +from DIRAC import S_ERROR, S_OK from DIRAC.ConfigurationSystem.Client.Helpers import Registry -from DIRAC.ConfigurationSystem.Client.Helpers.Path import cfgPath from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations +from DIRAC.Core.Security import Properties +from DIRAC.Core.Utilities.SiteSEMapping import getSEsForSite +from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers from DIRAC.Resources.Storage.StorageElement import StorageElement from DIRAC.ResourceStatusSystem.Client.SiteStatus import SiteStatus from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient, getFilesToStage +from DIRAC.WorkloadManagementSystem.Client import JobStatus from DIRAC.WorkloadManagementSystem.Client.JobState.JobState import JobState -from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB -from DIRAC.WorkloadManagementSystem.Client import JobStatus +from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor class JobScheduling(OptimizerExecutor):