|
1 | 1 | """ |
2 | 2 | Base class for all agent modules |
3 | 3 | """ |
| 4 | +import datetime |
| 5 | +import importlib.metadata |
| 6 | +import inspect |
4 | 7 | import os |
| 8 | +import signal |
5 | 9 | import threading |
6 | 10 | import time |
7 | | -import signal |
8 | | -import importlib.metadata |
9 | | -import inspect |
10 | | -import datetime |
| 11 | + |
11 | 12 | import psutil |
12 | 13 |
|
13 | 14 | import DIRAC |
14 | | -from DIRAC import S_OK, S_ERROR, gConfig, gLogger, rootPath |
15 | | -from DIRAC.Core.Utilities.File import mkDir |
| 15 | +from DIRAC import S_ERROR, S_OK, gConfig, gLogger, rootPath |
| 16 | +from DIRAC.ConfigurationSystem.Client import PathFinder |
| 17 | +from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations |
16 | 18 | from DIRAC.Core.Utilities import Network, TimeUtilities |
17 | | -from DIRAC.Core.Utilities.Shifter import setupShifterProxyInEnv |
| 19 | +from DIRAC.Core.Utilities.File import mkDir |
18 | 20 | from DIRAC.Core.Utilities.ReturnValues import isReturnStructure |
19 | | -from DIRAC.ConfigurationSystem.Client import PathFinder |
| 21 | +from DIRAC.Core.Utilities.Shifter import setupShifterProxyInEnv |
20 | 22 | from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler |
21 | | -from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations |
22 | 23 |
|
23 | 24 |
|
24 | 25 | class AgentModule: |
@@ -68,7 +69,6 @@ def __init__(self, agentName, loadName, baseAgentName=False, properties={}): |
68 | 69 | They are used to populate __codeProperties |
69 | 70 |
|
70 | 71 | The following Options are used from the Configuration: |
71 | | - - /DIRAC/Setup |
72 | 72 | - Status |
73 | 73 | - Enabled |
74 | 74 | - PollingTime default = 120 |
@@ -113,7 +113,6 @@ def __init__(self, agentName, loadName, baseAgentName=False, properties={}): |
113 | 113 | "loadSection": PathFinder.getAgentSection(loadName), |
114 | 114 | "cyclesDone": 0, |
115 | 115 | "totalElapsedTime": 0, |
116 | | - "setup": gConfig.getValue("/DIRAC/Setup", "Unknown"), |
117 | 116 | "alive": True, |
118 | 117 | } |
119 | 118 | self.__moduleProperties["system"], self.__moduleProperties["agentName"] = agentName.split("/") |
@@ -201,7 +200,6 @@ def am_initialize(self, *initArgs): |
201 | 200 | self.log.notice("=" * 40) |
202 | 201 | self.log.notice(f"Loaded agent module {self.__moduleProperties['fullName']}") |
203 | 202 | self.log.notice(f" Site: {DIRAC.siteName()}") |
204 | | - self.log.notice(f" Setup: {gConfig.getValue('/DIRAC/Setup')}") |
205 | 203 | self.log.notice(f" Agent version: {self.__codeProperties['version']}") |
206 | 204 | self.log.notice(f" DIRAC version: {DIRAC.version}") |
207 | 205 | self.log.notice(f" DIRAC platform: {DIRAC.getPlatform()}") |
|
0 commit comments