Agent is the main entry point for the configuration validator agent.
The agent is executed on the different nodes of the cloud and sends back configuration values and metadata to the configuration validator datasource driver.
congress.cfg_validator.agent.agent.
Config
(path, template, service_name)¶Bases: object
Encapsulates a configuration file and its meta-data.
ivar path: | Path to the configuration on the local file system. |
---|---|
ivar template: | A Template object to use for parsing the configuration. |
ivar data: | The normalized Namespace loaded by oslo-config, contains the parsed values. |
ivar hash: | Hash of the configuration file, salted with the hostname and the template hash |
ivar service_name: | |
The associated service name |
get_info
()¶Information on the configuration file.
Returns: | a quadruple made of: * the hash of the template, * the path to the file, * the content * the service name. |
---|
parse
(host)¶Parses the config at the path given. Updates data and hash.
host: the name of the host where the config is. Used for building a unique hash.
sanitize_config
(conf)¶Sanitizes some cfg.ConfigOpts values, given its options meta-data.
Parameters: | conf – A cfg.ConfigOpts object, pre-loaded with its options meta-data and with its configurations values. |
---|
congress.cfg_validator.agent.agent.
ConfigManager
(host, services_files)¶Bases: object
Manages the services configuration files on a node and their meta-data.
ivar host: | A hostname. |
---|---|
ivar configs: | A dict mapping config hashes to their associated Config object. |
ivar templates: | A dict mapping template hashes to their associated Template object. |
ivar namespaces: | |
A dict mapping namespace hashes to their associated Namespace object. |
add_template
(template_path)¶Adds a new template (loads it from path).
Parameters: | template_path – a valid path to the template file. |
---|
get_template_by_path
(template_path)¶Given a path finds the corresponding template if it is registered
Parameters: | template_path – the path of the searched template |
---|---|
Returns: | None or the template |
register_config
(config_path, template_path, service_name)¶Register a configuration file and its associated template.
Template and config are actually parsed and loaded.
Parameters: |
|
---|
register_service
(service_name, files)¶Register all configs for an identified service.
Inaccessible files are ignored and files registration pursues.
Parameters: |
|
---|
congress.cfg_validator.agent.agent.
Namespace
(name)¶Bases: object
Encapsulates a namespace, as defined by oslo-config-generator.
It contains the actual meta-data of the options. The data is loaded from the service source code, by means of oslo-config-generator.
get_info
()¶Information on the namespace
Returns: | a tuple containing * data: the content of the namespace * name: the name of the namespace |
---|
load
(name)¶Loads a namespace from disk
Parameters: | name – the name of namespace to load. |
---|---|
Returns: | a fully configured namespace. |
congress.cfg_validator.agent.agent.
Template
(path, output_file)¶Bases: object
Describes a template, as defined by oslo-config-generator.
ivar name: | The name, as used by oslo-config-generator. |
---|---|
ivar path: | The path to the template configuration file, as defined by oslo-config-generator, on the local file system. |
ivar output_file: | |
The default output path for this template. | |
ivar namespaces: | |
A set of Namespace objects, which make up this template. |
get_info
()¶Info on the template
Returns: | a quadruple made of: * path: the path to the template path * name: the name of the template * output_fle: * namespaces: an array of namespace hashes. |
---|
load
(template_path)¶Loads a template configuration file
Parameters: | template_path – path to the template |
---|---|
Returns: | a fully configured Template object. |
congress.cfg_validator.agent.agent.
ValidatorAgentEndpoint
(conf=None)¶Bases: object
Validator Agent.
It is used as an RPC endpoint.
get_config
(context, **kwargs)¶“Sends back a config
Parameters: |
|
---|---|
Returns: | the config or None if not found |
get_namespace
(context, **kwargs)¶“Sends back a namespace
Parameters: |
|
---|---|
Returns: | the namespace or None if not found |
get_template
(context, **kwargs)¶“Sends back a template
Parameters: |
|
---|---|
Returns: | the template or None if not found |
publish_configs_hashes
(context, **kwargs)¶“Sends back all configuration hashes
publish_templates_hashes
(context, **kwargs)¶“Sends back all template hashes
congress.cfg_validator.agent.agent.
main
()¶Agent entry point
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.