@@ -98,12 +98,7 @@ def __init__(self, agentName, loadName, baseAgentName=False, properties={}):
98
98
the configuration Option 'shifterProxy' must be set, a default may be given
99
99
in the initialize() method.
100
100
"""
101
- if baseAgentName and agentName == baseAgentName :
102
- self .log = gLogger
103
- standaloneModule = True
104
- else :
105
- self .log = gLogger .getSubLogger (agentName , child = False )
106
- standaloneModule = False
101
+ self .log = gLogger .getSubLogger (agentName , child = False )
107
102
108
103
self .__basePath = gConfig .getValue ("/LocalSite/InstancePath" , rootPath )
109
104
self .__agentModule = None
@@ -115,7 +110,6 @@ def __init__(self, agentName, loadName, baseAgentName=False, properties={}):
115
110
"loadName" : loadName ,
116
111
"section" : PathFinder .getAgentSection (agentName ),
117
112
"loadSection" : PathFinder .getAgentSection (loadName ),
118
- "standalone" : standaloneModule ,
119
113
"cyclesDone" : 0 ,
120
114
"totalElapsedTime" : 0 ,
121
115
"setup" : gConfig .getValue ("/DIRAC/Setup" , "Unknown" ),
@@ -171,6 +165,9 @@ def am_initialize(self, *initArgs):
171
165
This is called by the AgentReactor, should not be overridden.
172
166
"""
173
167
agentName = self .am_getModuleParam ("fullName" )
168
+
169
+ self .__initializeMonitor ()
170
+
174
171
result = self .initialize (* initArgs )
175
172
if not isReturnStructure (result ):
176
173
return S_ERROR ("initialize must return S_OK/S_ERROR" )
@@ -182,8 +179,6 @@ def am_initialize(self, *initArgs):
182
179
# Set the work directory in an environment variable available to subprocesses if needed
183
180
os .environ ["AGENT_WORKDIRECTORY" ] = workDirectory
184
181
185
- self .__initializeMonitor ()
186
-
187
182
self .__moduleProperties ["shifterProxy" ] = self .am_getOption ("shifterProxy" )
188
183
if len (self .__moduleProperties ["executors" ]) < 1 :
189
184
return S_ERROR ("At least one executor method has to be defined" )
@@ -295,6 +290,7 @@ def __initializeMonitor(self):
295
290
# if the "EnableActivityMonitoring" flag in "yes" or "true" in the cfg file.
296
291
self .activityMonitoring = Operations ().getValue ("EnableActivityMonitoring" , False )
297
292
if self .activityMonitoring :
293
+ self .log .debug ("Using activity monitoring" )
298
294
# The import needs to be here because of the CS must be initialized before importing
299
295
# this class (see https://github.com/DIRACGrid/DIRAC/issues/4793)
300
296
from DIRAC .MonitoringSystem .Client .MonitoringReporter import MonitoringReporter
0 commit comments