[Freeipa-devel] [freeipa PR#534][comment] Move csrgen templates into ipaclient package

tiran freeipa-github-notification at redhat.com
Fri Mar 3 07:34:04 UTC 2017


  URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

tiran commented:
"""
In my opinion, a user should never modify a file that managed by a package manager and not explicitly marked as a config file. Both files in ```/usr/share``` and ```site-packages``` are not config files.

How about http://jinja.pocoo.org/docs/2.9/api/#jinja2.ChoiceLoader and this idea?

```
loader = jinja2.ChoiceLoader(
    jinja2.FileSystemLoader(os.path.join(api.env.conf_dir, 'csrgen/templates')),
    jinja2.PackageLoader('ipaclient', 'csrgen/templates'),
)
```

This allows users to override the templates by copying them to ```/etc/ipa/csrgen/templates```. We'd need similar code for the JSON files, too.
"""

See the full comment at https://github.com/freeipa/freeipa/pull/534#issuecomment-283881532


More information about the Freeipa-devel mailing list