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

Aleksey Kasatkin akasatkin at mirantis.com
Tue Jul 28 16:13:30 UTC 2015


Evgeniy, do we need to remove jinja before July 30th ?


Aleksey Kasatkin


On Tue, Jul 28, 2015 at 6:40 PM, Aleksey Kasatkin <akasatkin at mirantis.com>
wrote:

> AFAIU, string.Template doesn't help.
>
> This seems to be helpful:
>
> import re
> def interp(string, params):
>   for item in re.findall(r'#\{([^}]*)\}', string):
>     string = string.replace('#{%s}' % item, str(eval(item, {}, params)))
>   return string
>
>
> Evgeniy, do you know some better options for this?
>
>
>
> Aleksey Kasatkin
>
>
> On Tue, Jul 28, 2015 at 1:12 PM, Sergey Vasilenko <svasilenko at mirantis.com
> > wrote:
>
>> 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
>>>
>>
>> I think it's a better solution for this issue.
>>
>> /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/ee6fe55a/attachment.html>


More information about the OpenStack-dev mailing list