Providers related defines.
All providers need to inherit this class.
String that is being used to start comment line in config files.
Provider identification string.
List of names that are associated with a provider.
By default providers are associated only with theirs names.
Shell command to control service daemon.
For example, /etc/init.d/httd to start and stop HTTP server.
Command to run in shell mode to control service daemon.
Configuration files supported by provider.
Property contains fake names internally associated with final configuration files. If there is only one configuration file supported by provider, names don’t make sense and even None is fine.
Is service running.
Get configuration path relatively to –output directory.
Parameters: | confile – one of confiles names |
---|---|
Returns: | path to the final configuration file associated with filename, TODO, redesign: None if confile should be treated as an .ini file, False custom configl processing |
Final configuration file header.
The header that will be added to each final configuration file.
Parameters: |
|
---|---|
Returns: | list of lines to add |
Confile header.
These lines will be added to the final configuration file before each confile, even if several confiles go to the same final configuration file.
Parameters: |
|
---|---|
Returns: | list of lines to add |
Final configuration file footer.
The footer that will be added to each final configuration file.
Parameters: |
|
---|---|
Returns: | list of lines to add |
Confile footer.
These lines will be added to the final configuration file after each confile, even if several confiles go to the same final configuration file.
Parameters: |
|
---|---|
Returns: | list of lines to add |
Start service.
Parameters: | force – force activating without checking current status |
---|---|
Returns: | True is service was started |
Stop service.
Returns: | True is service was stapped |
---|
Export variables that might be used in configuration sources.
Parameters: | envars – dictionary to export variables to |
---|
Convert configuration file.
Parameters: |
|
---|---|
Returns: | function should return new lines |
Does environment needs to be prepared.
Will be called after applying new configuration to make sure that final environment for consistence and tunning it otherwise.
Parameters: |
|
---|---|
Returns: | True if environment was changed |
Apply configuration changes, e.g., restart service.
Parameters: |
|
---|---|
Returns: | True if provider has done something for applying changes, e.g., restarted daemon |
Providers that current one requires.
Parameters: | conftext – libmace.files.Conftext object with full configuration |
---|---|
Returns: | list of provider names |
All depending providers need to be included to the same configuration as the current one belongs to. It is only about dependencies between providers, not between services they configure, e.g., some provider might depend on envars exported by enother one.
Packages that provider requires.
Parameters: | conftext – libmace.files.Conftext object with full configuration |
---|---|
Returns: | list of native package names |
Add finale configuration files to transation.
Parameters: |
|
---|
Populate list of providers.
Needs to be called on program start.