def _ex_initialize( cls, exeName, loadName ): cls.__properties = { 'fullName' : exeName, 'loadName' : loadName, 'section' : PathFinder.getExecutorSection( exeName ), 'loadSection' : PathFinder.getExecutorSection( loadName ), 'messagesProcessed' : 0, 'reconnects' : 0, 'setup' : gConfig.getValue( "/DIRAC/Setup", "Unknown" ) } cls.__basePath = gConfig.getValue( '/LocalSite/InstancePath', rootPath ) cls.__defaults = {} cls.__defaults[ 'MonitoringEnabled' ] = True cls.__defaults[ 'Enabled' ] = True cls.__defaults[ 'ControlDirectory' ] = os.path.join( cls.__basePath, 'control', *exeName.split( "/" ) ) cls.__defaults[ 'WorkDirectory' ] = os.path.join( cls.__basePath, 'work', *exeName.split( "/" ) ) cls.__defaults[ 'ReconnectRetries' ] = 10 cls.__defaults[ 'ReconnectSleep' ] = 5 cls.__properties[ 'shifterProxy' ] = '' cls.__properties[ 'shifterProxyLocation' ] = os.path.join( cls.__defaults[ 'WorkDirectory' ], '.shifterCred' ) cls.__mindName = False cls.__mindExtraArgs = False cls.__freezeTime = 0 cls.__fastTrackEnabled = True cls.log = gLogger.getSubLogger( exeName, child = False ) try: result = cls.initialize() except Exception, excp: gLogger.exception( "Exception while initializing %s" % loadName ) return S_ERROR( "Exception while initializing: %s" % str( excp ) )
def _ex_initialize(cls, exeName, loadName): cls.__properties = { 'fullName': exeName, 'loadName': loadName, 'section': PathFinder.getExecutorSection(exeName), 'loadSection': PathFinder.getExecutorSection(loadName), 'messagesProcessed': 0, 'reconnects': 0, 'setup': gConfig.getValue("/DIRAC/Setup", "Unknown") } cls.__basePath = gConfig.getValue('/LocalSite/InstancePath', rootPath) cls.__defaults = {} cls.__defaults['MonitoringEnabled'] = True cls.__defaults['Enabled'] = True cls.__defaults['ControlDirectory'] = os.path.join( cls.__basePath, 'control', *exeName.split("/")) cls.__defaults['WorkDirectory'] = os.path.join(cls.__basePath, 'work', *exeName.split("/")) cls.__defaults['ReconnectRetries'] = 10 cls.__defaults['ReconnectSleep'] = 5 cls.__properties['shifterProxy'] = '' cls.__properties['shifterProxyLocation'] = os.path.join( cls.__defaults['WorkDirectory'], '.shifterCred') cls.__mindName = False cls.__mindExtraArgs = False cls.__freezeTime = 0 cls.__fastTrackEnabled = True cls.log = gLogger.getSubLogger(exeName, child=False) try: result = cls.initialize() except Exception, excp: gLogger.exception("Exception while initializing %s" % loadName) return S_ERROR("Exception while initializing: %s" % str(excp))
def _ex_initialize(cls, exeName, loadName): cls.__properties = { "fullName": exeName, "loadName": loadName, "section": PathFinder.getExecutorSection(exeName), "loadSection": PathFinder.getExecutorSection(loadName), "messagesProcessed": 0, "reconnects": 0, "setup": gConfig.getValue("/DIRAC/Setup", "Unknown"), } cls.__defaults = {} cls.__defaults["MonitoringEnabled"] = True cls.__defaults["Enabled"] = True cls.__defaults["ControlDirectory"] = os.path.join(rootPath, "control", *exeName.split("/")) cls.__defaults["WorkDirectory"] = os.path.join(rootPath, "work", *exeName.split("/")) cls.__defaults["ReconnectRetries"] = 10 cls.__defaults["ReconnectSleep"] = 5 cls.__defaults["shifterProxy"] = "" cls.__defaults["shifterProxyLocation"] = os.path.join(cls.__defaults["WorkDirectory"], ".shifterCred") cls.__properties["shifterProxy"] = "" cls.__properties["shifterProxyLocation"] = os.path.join(cls.__defaults["WorkDirectory"], ".shifterCred") cls.__mindName = False cls.__mindExtraArgs = False cls.__freezeTime = 0 cls.__fastTrackEnabled = True cls.log = gLogger.getSubLogger(exeName) try: result = cls.initialize() # pylint: disable=no-member except Exception as excp: gLogger.exception("Exception while initializing %s" % loadName, lException=excp) return S_ERROR("Exception while initializing: %s" % str(excp)) if not isReturnStructure(result): return S_ERROR("Executor %s does not return an S_OK/S_ERROR after initialization" % loadName) return result