genvid.toolbox.ConsulTemplateTool¶
-
class
genvid.toolbox.
ConsulTemplateTool
(**kwargs)¶ Bases:
genvid.toolbox.vault.VaultTool
A wrapper over consul-template to generated file from variables set in consul, vault or from the environment.
Warning: this class is only used for starting the supervisor jobs. We do not recommended to use for other purpose.
-
CONSUL_TEMPLATE
¶ The consul-template binary location
-
consul_template
(template, dest=None, *, consul_addr=None, log_level='warn', timeout=30, **kwargs)¶ Build new file from template using consul-template.
Args:
template: The path of the template file.
dest: The destination. If none, do a dry run instead.
consul_addr: The consul ip to use. If None, it will used get_consul_ip(), on port 8500.
log_level: The log level of consul-template. Valid values are ‘debug’, ‘info’, ‘warn’ and ‘err’.
timeout: A timeout value (in seconds) for consul-template to finish. Consul-template is blocking if a key is required but not present. This will kill the child process and raise a
subprocess.TimeoutExpired
if the child process doesn’t terminate in time. Set to None to wait indefinitely.kwargs: any other keyword arguments pass to
run()
.Note:
Since absolute path are not well support with consul-template on Windows, you must pass paths relative to the current working directory (:attr:`ROOTDIR` by default). Also, a dry run always output a first line containing '> '
-
consul_template_filter
= '(?m)^.*((\\[DEBUG\\] \\(runner\\) (final|checking|running|missing|diffing|was|watching|rendering|stopping))|(\\[INFO\\])).*(\\r\\n|\\n)'¶
-
-
class
consul_template.
ConsulTemplateTool
¶ Implementation of
genvid.toolbox.ConsulTemplateTool