A set of common tools to be used in pilot commands

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase(pilotParams, dummy='')

Bases: object

CommandBase is the base class for every command in the pilot commands toolbox

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output


Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.Logger(name='Pilot', debugFlag=False, pilotOutput='pilot.out')

Bases: object

Basic logger object, for use inside the pilot. Just using print.

debug(msg, header=True)
error(msg, header=True)
info(msg, header=True)
warn(msg, header=True)
class DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.ObjectLoader(baseModules, log)

Bases: object

Simplified class for loading objects from a DIRAC installation.


ol = ObjectLoader() object, modulePath = ol.loadObject( ‘pilot’, ‘LaunchAgent’ )

loadModule(modName, hideExceptions=False)

Auto search which root module has to be used

loadObject(package, moduleName, command)

Load an object from inside a module

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.PilotParams

Bases: object

Class that holds the structure with all the parameters to be used across all the commands

DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.getCommand(params, commandName, log)

Get an instantiated command object for execution. Commands are looked in the following modules in the order:

  1. <CommandExtension>Commands
  2. pilotCommands
  3. <Extension>.WorkloadManagementSystem.PilotAgent.<CommandExtension>Commands
  4. <Extension>.WorkloadManagementSystem.PilotAgent.pilotCommands
  5. DIRAC.WorkloadManagementSystem.PilotAgent.<CommandExtension>Commands
  6. DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands

Note that commands in 3.-6. can only be used of the the DIRAC installation has been done. DIRAC extensions are taken from -e ( –extraPackages ) option of the pilot script.

DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.retrieveUrlTimeout(url, fileName, log, timeout=0)

Retrieve remote url to local file, with timeout wrapper