LocalConfiguration¶
This is the guy that parses and interprets the local configuration options.
- class DIRAC.ConfigurationSystem.Client.LocalConfiguration.LocalConfiguration(defaultSectionPath='')¶
Bases:
object
Main class to interface with Configuration of a running DIRAC Component.
- For most cases this is handled via
DIRAC.Core.Base.Script class for scripts
dirac-agent for agents
dirac-service for services
- __init__(defaultSectionPath='')¶
- addCFGFile(filePath)¶
Load additional .cfg file to be parsed
- addDefaultEntry(optionPath, value)¶
Define a default value for a Configuration data option
- addMandatoryEntry(optionPath)¶
Define a mandatory Configuration data option for the parsing of the command line
- deleteOption(optionPath)¶
Remove a Configuration Option from the local Configuration
- disableCS()¶
Do not contact Configuration Server upon initialization
- disableParsingCommandLine()¶
- enableCS()¶
Force the connection the Configuration Server
(And incidentaly reinitialize the ObjectLoader and logger)
- getDebugMode()¶
- getExtraCLICFGFiles()¶
Retrieve list of parsed .cfg files
- getPositionalArguments()¶
Retrieve list of command line positional arguments
- getUnprocessedSwitches()¶
Retrieve list of command line switches without a callback function
- initialize(componentName)¶
Make sure DIRAC is properly initialized
- isCSEnabled()¶
Retrieve current status of the connection to Configuration Server
- loadUserData()¶
This is the magic method that reads the command line and processes it It is used by the Script Base class and the dirac-service and dirac-agent scripts Before being called: - any additional switches to be processed - mandatory and default configuration configuration options must be defined.
- registerCmdOpt(shortOption, longOption, helpString, function=False)¶
Register a new command line option
- setConfigurationForAgent(agentName)¶
Declare this is a DIRAC agent
- setConfigurationForExecutor(executorName)¶
Declare this is a DIRAC agent
- setConfigurationForScript(scriptName)¶
Declare this is a DIRAC script
- setConfigurationForServer(serviceName)¶
Declare this is a DIRAC service
- setConfigurationForWeb(webName)¶
Declare this is a DIRAC agent
- setUsageMessage(usageMsg)¶
Define and parse message to be display by the showHelp method.
- Parameters
usageMsg (str) – script description that can contain Usage, Example, Arguments, Options blocks
- showHelp(dummy=False, exitCode=0)¶
Printout help message including a Usage message if defined via setUsageMessage method
- showLicense(dummy=False)¶
Print license
- syncRemoteConfiguration(strict=False)¶
Force a Resync with Configuration Server Under normal conditions this is triggered by an access to any configuration data.