genvid.toolbox.ConfigTool
Warning
This module has been deprecated. Although the code is still working for our oldest model, it is not expected to work with the new Bastion API.
- class genvid.toolbox.ConfigTool(*args, **kwargs)
Bases:
ConsulTool
Manage Genvid configuration.
Deprecated since version 1.33.0: Deprecated class.
- set_config_value(key, value)
Set configuration value.
- set_config(cfg: dict)
Set configuration.
Recursively transform the dictionary cfg into a list of key-value pairs to insert into Consul.
- clear_config(key='')
Delete the selected configuration and its children.
- load_config(*paths)
Load configuration from file.
- get_config(key)
Get configuration value.
- get_config_as_dict(key)
Get configuration value as a dictionary.
- show_config(key='')
Print configuration from key in JSON format.
- set_log_level(logger, level)
Set the service logger verbosity.
- get_loggers()
Get the list of loggers and their levels.
- show_loggers()
Print the list of loggers.
- add_config_commands()
Add the config commands to the parser.
Run from
add_commands()
to add the jobs commands to the parser.
- run_config_command(command, options)
Detect if the command is a config command and execute it.
Call from
run_command()
to handle config commands. All-in-one commands are added with the help ofadd_config_commands()
.Returns:
- handled, result: A tuple with a boolean saying if the
command were handled and it’s result if it was.
- class config.ConfigTool
Implementation of
genvid.toolbox.ConfigTool