Discussion:
[Freeipa-devel] [freeipa PR#534][opened] Move csrgen templates into ipaclient package
tiran
2017-03-02 15:13:32 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Author: tiran
Title: #534: Move csrgen templates into ipaclient package
Action: opened

PR body:
"""
csrgen broke packaging of ipaclient for PyPI. All csrgen related
resources are now package data of ipaclient package. Package data is
accessed with Jinja's PackageLoader() or through pkg_resources.

https://pagure.io/freeipa/issue/6714

Signed-off-by: Christian Heimes <***@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/534/head:pr534
git checkout pr534
tiran
2017-03-02 15:14:26 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

tiran commented:
"""
@LiptonB please have a look.
"""

See the full comment at https://github.com/freeipa/freeipa/pull/534#issuecomment-283680629
tiran
2017-03-02 16:21:55 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Author: tiran
Title: #534: Move csrgen templates into ipaclient package
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/534/head:pr534
git checkout pr534
tiran
2017-03-02 16:50:49 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Author: tiran
Title: #534: Move csrgen templates into ipaclient package
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/534/head:pr534
git checkout pr534
LiptonB
2017-03-03 02:57:54 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

LiptonB commented:
"""
Oops, sorry about the breakage. This seems fine to me, although I hadn't really been thinking of the templates and rules as data files. They're intended to be possible to modify, more like config files. (Come to think of it, `/usr/share` wasn't that appropriate for them either). So, that and the fact that they're now duplicated between `python2.*/site-packages` and `python3.*/site-packages` give me pause (especially if the user might edit them), but I don't have strong feelings about it.
"""

See the full comment at https://github.com/freeipa/freeipa/pull/534#issuecomment-283851563
tiran
2017-03-03 07:01:15 UTC
Permalink
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
tiran
2017-03-03 07:34:04 UTC
Permalink
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
tiran
2017-03-03 07:36:47 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Author: tiran
Title: #534: Move csrgen templates into ipaclient package
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/534/head:pr534
git checkout pr534
LiptonB
2017-03-06 15:23:10 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

LiptonB commented:
"""
I think this is a much better way to make it configurable than how I had it, and the implementation looks good to me. Thanks!
"""

See the full comment at https://github.com/freeipa/freeipa/pull/534#issuecomment-284427183
MartinBasti
2017-03-08 14:53:25 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

Label: +ack
dkupka
2017-03-08 14:59:51 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

dkupka commented:
"""
master:

* 80be18162921268be9c8981495c9e8a4de0c85cd Move csrgen templates into ipaclient package
* 177f07e163d6d591a1e609d35e0a6f6f5347551e Chain CSR generator file loaders
"""

See the full comment at https://github.com/freeipa/freeipa/pull/534#issuecomment-285063710
dkupka
2017-03-08 14:59:50 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Title: #534: Move csrgen templates into ipaclient package

Label: +pushed
dkupka
2017-03-08 14:59:53 UTC
Permalink
URL: https://github.com/freeipa/freeipa/pull/534
Author: tiran
Title: #534: Move csrgen templates into ipaclient package
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/534/head:pr534
git checkout pr534

Loading...