jinja builtin not available

41 views
Skip to first unread message

Akilesh K

unread,
May 26, 2015, 12:10:12 PM5/26/15
to salt-...@googlegroups.com
Hi all,

I get a strange error like below.
failed: Jinja variable 'int' is undefined

When I am doing something like below.
{% do phys_interfaces.update({int(salt['file.seek_read']('/sys/class/net/{}/ifindex'.format('eth0'),1,0)): 'eth0'}) %}

Any suggestions/ideas? Why isn't a builtin jinja method not available for me.

Thank you,
Akilesh
 

Colton Myers

unread,
Jun 1, 2015, 3:14:11 PM6/1/15
to salt-...@googlegroups.com
This is because `int` is actually a jinja filter, which you use with pipes:

{{ "10" | int }} will result in the integer 10.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Twitter/Github/IRC

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages