commit 1ca4bd0ab941f6c7aebf86bdf5ff47fdc1d2d3e2
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Jan 27 22:42:16 2018 +0300
add string template rendering capability
In some cases software deliberately allows drop-in config file usage
capabilities, for example, when it comes to enforcing policy, the
desired behavior varies from an operator to operator. For that reason it
is sometimes desirable to supply custom templates via config options.
Another use-case is templates that are passed from subordinates for a
primary charm to render.
Given that properties and desired adapters can be arbitrary the change
uses a dict of meta tuples of the following format to render templates
from strings based on adapter properties:
Reviewed: https:/ /review. openstack. org/538688 /git.openstack. org/cgit/ openstack/ charms. openstack/ commit/ ?id=1ca4bd0ab94 1f6c7aebf86bdf5 ff47fdc1d2d3e2
Committed: https:/
Submitter: Zuul
Branch: master
commit 1ca4bd0ab941f6c 7aebf86bdf5ff47 fdc1d2d3e2
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Jan 27 22:42:16 2018 +0300
add string template rendering capability
In some cases software deliberately allows drop-in config file usage
capabilities, for example, when it comes to enforcing policy, the
desired behavior varies from an operator to operator. For that reason it
is sometimes desirable to supply custom templates via config options.
Another use-case is templates that are passed from subordinates for a
primary charm to render.
Given that properties and desired adapters can be arbitrary the change
uses a dict of meta tuples of the following format to render templates
from strings based on adapter properties:
{config_ file_path: (relation_name, adapter property)}
relation names must be normalized (lowercase, underscores instead of
dashes. "options" relation name is used for a config adapter as usual.
In summary a string config file path should be used:
1. in the restart_map for a given derived class;
2. in string_templates dict as a key for a meta tuple
Change-Id: Ic85b22d0e5d497 c49c75243e3c280 140f940df66
Closes-Bug: #1741723