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.
Path to the configuration on the local file system.
A Template object to use for parsing the configuration.
The normalized Namespace loaded by oslo-config, contains the parsed values.
Hash of the configuration file, salted with the hostname and the template hash
The associated service name
get_info
()¶Information on the configuration file.
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.
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.
A hostname.
A dict mapping config hashes to their associated Config object.
A dict mapping template hashes to their associated Template object.
A dict mapping namespace hashes to their associated Namespace object.
add_template
(template_path)¶Adds a new template (loads it from path).
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
template_path – the path of the searched template
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.
config_path – a valid path to the config file.
template_path – a valid path to the template file.
register_service
(service_name, files)¶Register all configs for an identified service.
Inaccessible files are ignored and files registration pursues.
service_name – The name of the service
files – A dict, mapping a configuration path to its associated template path
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.
name: The name, as used by oslo-config-generator. data: The meta-data of the configuration options. hash: Hash of the namespace.
get_info
()¶Information on the namespace
a tuple containing * data: the content of the namespace * name: the name of the namespace
load
(name)¶Loads a namespace from disk
name – the name of namespace to load.
a fully configured namespace.
congress.cfg_validator.agent.agent.
Template
(path, output_file)¶Bases: object
Describes a template, as defined by oslo-config-generator.
The name, as used by oslo-config-generator.
The path to the template configuration file, as defined by oslo-config-generator, on the local file system.
The default output path for this template.
A set of Namespace objects, which make up this template.
get_info
()¶Info on the template
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
template_path – path to the template
a fully configured Template object.
congress.cfg_validator.agent.agent.
ValidatorAgentEndpoint
(conf=None)¶Bases: object
Validator Agent.
It is used as an RPC endpoint.
config_manager: ConfigManager object. driver_api: RPC client to communicate with the driver.
get_config
(context, **kwargs)¶“Sends back a config
context – the RPC context
hash – the hash of the config to send
the config or None if not found
get_namespace
(context, **kwargs)¶“Sends back a namespace
context – the RPC context
hash – the hash of the namespace to send
the namespace or None if not found
get_template
(context, **kwargs)¶“Sends back a template
context – the RPC context
hash – the hash of the template to send
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.