[openstack-dev] [fuel] FF Exception request for Templates for Networking feature

Evgeniy L eli at mirantis.com
Tue Jul 28 10:02:36 UTC 2015


Hi Sergey,

Thanks, now I see why we had misunderstanding. The problem is currently
all set of features which Jinja2 provides is available for the user. As far
as
I know there is no way in Jinja to disable all of the functionality except
just
substitution.

If we need only substitution, probably it's better to use standard
templating
in python [1], there is a way to redefine tokens, so you will be able to use
<% %> syntax if you want to.

[1] https://docs.python.org/2.6/library/string.html#template-strings
<https://docs.python.org/dev/library/string.html#template-strings>
[2] http://pymotw.com/2/string/#advanced-templates

On Tue, Jul 28, 2015 at 12:25 PM, Sergey Vasilenko <svasilenko at mirantis.com>
wrote:

>
> On Tue, Jul 28, 2015 at 11:52 AM, Evgeniy L <eli at mirantis.com> wrote:
>
>> Hi Alexander, I don't agree with your statements
>>
>> >> [1] - I just uses <% and %> to substitute values.
>>
>> It's what templating is about, you have some text preprocessor to
>> substitute values.
>>
>
> Network templates feature don't mean any  "text preprocessor" actions.
> Only value substitutions
>
>
>> >> That is not ERB style template language.
>>
>> ERB uses the same syntax, hence it Is ERB style.
>>
>
> ... hence it looks like ERB. not more.
> Not only ruby used for programming. Non only EBD -- is template language.
> ;)
>
>
>> >> [2] - We are not using Jinja templating (it is just yaml file, not
>> html template), we are using Jinja placeholder substitution.
>>
>> We *are using* jinja templating (I don't understand why you mention here
>> html),
>> with all it's features and here is the proof [1].
>>
>
> We don't promise use Junja (or whatever) template language for this
> feature.
> If some jinja features allowed for parsing Network template -- it's a bug.
> We should check it and fix it.
> Only value substitutions should allow in the network templates.
>
>
>> >> [3] - Templates are for people who do not care about Jinja/ERB (maybe
>> some familiar with Puppet/Chef), so no confusion.
>>
>> That is not correct, every template has it's own syntax, so people have
>> to care about
>> specific implementation i.e. Jinja or ERB, and there will be confusion
>> when somebody will
>> try to use ERB specific features, and she/he will fail because you hide
>> Jinja under ERB
>> syntax.
>>
>
> I, partially, agree with you. But please honored to following facts:
> * In the deployers world used Jinja and ERB syntax.
> * ERB used more often, because Ansible (I don't know another popular
> deployers tools with Jinja templating) is to young.
> * Plenty of syntax features is a really hell.
>
> In the Network templates we don't suppose anything other than a simple
> substitution variable values.
> All logic of template processing implementing on Nailgun side. Now on the
> template parsing, later -- on the network manipulation class.
> Allowance of mix template language and Nailgun logic may lead to heavy
> diagnostic issues.
> Meantime I don't see any cases, where required something more, than
> substitution.
>
>
>
> /sv
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150728/0bc97c82/attachment.html>


More information about the OpenStack-dev mailing list