Skip to content

Commit f4fe9f9

Browse files
committed
style: organized the imports
1 parent 494e931 commit f4fe9f9

File tree

10 files changed

+28
-22
lines changed

10 files changed

+28
-22
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient
3939
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
4040
from DIRAC.WorkloadManagementSystem.DB.SandboxMetadataDB import SandboxMetadataDB
41-
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import RIGHT_DELETE
4241
from DIRAC.WorkloadManagementSystem.DB.StatusUtils import kill_delete_jobs
42+
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import RIGHT_DELETE
4343
from DIRAC.WorkloadManagementSystem.Utilities.JobParameters import getJobParameters
4444

4545

src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
99
"""
1010

11-
import os
11+
import hashlib
1212
import json
13+
import os
1314
import shutil
14-
import hashlib
15+
1516
import requests
1617

1718
from DIRAC import S_OK
1819
from DIRAC.Core.Base.AgentModule import AgentModule
19-
from DIRAC.Core.Security.Locations import getHostCertificateAndKeyLocation, getCAsLocation
20+
from DIRAC.Core.Security.Locations import getCAsLocation, getHostCertificateAndKeyLocation
2021
from DIRAC.DataManagementSystem.Client.DataManager import DataManager
2122
from DIRAC.WorkloadManagementSystem.Utilities.PilotCStoJSONSynchronizer import PilotCStoJSONSynchronizer
2223

src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader
2121
from DIRAC.Core.Utilities.TimeUtilities import fromString, second, toEpoch
2222
from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus, JobStatus
23-
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import RIGHT_KILL
2423
from DIRAC.WorkloadManagementSystem.DB.StatusUtils import kill_delete_jobs
24+
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import RIGHT_KILL
2525
from DIRAC.WorkloadManagementSystem.Utilities.JobParameters import getJobParameters
2626
from DIRAC.WorkloadManagementSystem.Utilities.Utils import rescheduleJobs
2727

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"""
33
import multiprocessing
44
import os
5-
from pathlib import Path
6-
import pytest
75
import time
86
from concurrent.futures import ProcessPoolExecutor
97
from functools import partial
8+
from pathlib import Path
109

11-
from DIRAC import gLogger, S_OK, S_ERROR
10+
import pytest
1211
from DIRAC.Core.Security.X509Chain import X509Chain # pylint: disable=import-error
12+
13+
from DIRAC import S_ERROR, S_OK, gLogger
1314
from DIRAC.Resources.Computing.BatchSystems.TimeLeft.TimeLeft import TimeLeft
1415
from DIRAC.Resources.Computing.ComputingElementFactory import ComputingElementFactory
1516
from DIRAC.Resources.Computing.test.Test_PoolComputingElement import badJobScript, jobScript

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PilotLoggingAgent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
""" Test class for PilotLoggingAgent Agent
22
"""
33
import os
4-
import time
54
import tempfile
5+
import time
6+
from unittest.mock import MagicMock, patch
67

78
import pytest
8-
from unittest.mock import MagicMock, patch
99

1010
# DIRAC Components
1111
import DIRAC.WorkloadManagementSystem.Agent.PilotLoggingAgent as plaModule
12+
from DIRAC import S_ERROR, S_OK, gConfig, gLogger
1213
from DIRAC.WorkloadManagementSystem.Agent.PilotLoggingAgent import PilotLoggingAgent
13-
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
1414

1515
gLogger.setLevel("DEBUG")
1616

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PilotStatusAgent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
""" Test class for Pilot Status Agent
22
"""
3-
import pytest
43
from unittest.mock import MagicMock
54

5+
import pytest
6+
7+
from DIRAC import S_OK, gLogger
8+
69
# DIRAC Components
710
from DIRAC.WorkloadManagementSystem.Agent.PilotStatusAgent import PilotStatusAgent
8-
from DIRAC import gLogger, S_OK
911

1012
# Mock objects
1113
mockReply = MagicMock()

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PushJobAgent.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33

44
# imports
55
import os
6-
from pathlib import Path
76
import shutil
7+
from collections import defaultdict
8+
from pathlib import Path
89
from unittest.mock import Mock
10+
911
import pytest
10-
from collections import defaultdict
12+
13+
from DIRAC import S_ERROR, S_OK, gLogger
1114

1215
# DIRAC Components
1316
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
1417
from DIRAC.WorkloadManagementSystem.Agent.PushJobAgent import PushJobAgent
1518
from DIRAC.WorkloadManagementSystem.Agent.test.Test_Agent_SiteDirector import config
16-
17-
from DIRAC import gLogger, S_OK, S_ERROR
1819
from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus
1920
from DIRAC.WorkloadManagementSystem.Client.JobReport import JobReport
2021

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
""" Test class for Stalled Job Agent
22
"""
3-
import pytest
43
from unittest.mock import MagicMock
54

5+
import pytest
6+
7+
from DIRAC import gLogger
8+
69
# DIRAC Components
710
from DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent import StalledJobAgent
8-
from DIRAC import gLogger
911

1012
# Mock Objects
1113
mockAM = MagicMock()

src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperOfflineTemplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
We assume this script is executed in a specific environment where DIRAC is available.
77
"""
88
import hashlib
9-
import sys
109
import json
1110
import os
11+
import sys
1212

1313
sitePython = os.path.realpath("@SITEPYTHON@")
1414
if sitePython:

src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
- the resolution of the inpt data failed
1212
- the JobWrapper ended with the status DErrno.EWMSRESC
1313
"""
14-
import sys
1514
import json
1615
import os
16+
import sys
1717

1818
sitePython = os.path.realpath("@SITEPYTHON@")
1919
if sitePython:
@@ -35,7 +35,6 @@
3535
transferInputSandbox,
3636
)
3737

38-
3938
os.umask(0o22)
4039

4140

0 commit comments

Comments
 (0)