class genvid.toolbox.ConsulTemplateTool(**kwargs)

Bases: genvid.toolbox.vault.VaultTool

A wrapper over consul-template that generates files from variables set in Consul, Vault, or from the environment.


This class is only used for starting the supervisor jobs. We do not recommend using it for any other purpose.


The consul-template binary location

consul_template(template, dest=None, *, consul_addr=None, log_level='warn', timeout=30, **kwargs)

Build a new file from a template using consul-template.


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 use 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().


Since absolute paths aren't well supported with
consul-template on Windows, you must pass paths relative
to the current working directory (:attr:`ROOTDIR` by

A dry run always outputs 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