Process configuration files.
Load tree of configuration sources.
Parameters: |
|
---|---|
Returns: | a tuple of ({provider: Conftext}, {var_name: var_value}); the first item is for found sources and the last one is for found variables |
Apply configuration to final environment.
Parameters: |
|
---|---|
Returns: | list of providers that configuration was applied |
Return configuration sources statistic.
Parameters: |
|
---|---|
Returns: | a tuple of (total, merged, overriden, hidden) numbers of files |
Get uid by user name.
Should be used instead of pwd.getpwnam. Was introduced only to support unittests.
Parameters: | name – user name |
---|---|
Returns: | uid integer value |
Get gid by group name.
Should be used instead of grp.getgrnam. Was introduced only to support unittests.
Parameters: | name – user name |
---|---|
Returns: | uid integer value |
Change file ownership.
Should be used instead of os.chown. Was introduced only to support unittests.
Parameters: |
|
---|
Collect configuration sources for the same provider.
SourceFile objects for the same confile.
Parameters: | confile – the name of a confile |
---|---|
Returns: | list of SourceFile objects |
Source file representation.
This class describes only source configuration file, i.e., it is a part of source confile and there are might be several files for the same confile in sources tree.
Parameters: |
|
---|
Check if this configuration file is being overriden by another one.
Parameters: | other – SourceFile that substitutes this one |
---|
Configuration application transation.
These objects will be used while applying final configuration. All changes need to be done via Transaction methods to let it rollback changes on fails.
Parameters: | root – path to the root directory with final configuration, e.g., / |
---|
Artificial provider configuration. Some providers might support artificial configuration, i.e., if there is no singular configuration syntax. For these providers config will contain configuration parsed from .ini files.
Variables exported by all providers
Are there any changes made within this transation.
Make transation dirty and force it applying.
Arbitrary path starting from final configuration root directory.
Parameters: | path – relative path |
---|---|
Returns: | specified path with prefixing root directory |
Make sure that path doesn’t exist.
Parameters: |
|
---|---|
Returns: | True if something was changed |
Change a file.
Parameters: |
|
---|---|
Returns: | True if something was changed |
Change a directory.
Parameters: |
|
---|---|
Returns: | True if something was changed |
Create a symlink.
Parameters: |
|
---|---|
Returns: | True if something was changed |
Revert all previsly made changes within this transation.
Cleanup rollback history, so rollback() call will do nothing.