1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add basename and dirname to the core jinja2 filters

This commit is contained in:
Bryan Larsen 2013-05-22 14:06:18 -04:00
parent 8f3b2b281f
commit f629baef11

View file

@ -17,6 +17,7 @@
import base64
import json
import os.path
import yaml
def to_nice_yaml(*a, **kw):
@ -45,5 +46,9 @@ class FilterModule(object):
'to_yaml': yaml.safe_dump,
'to_nice_yaml': to_nice_yaml,
'from_yaml': yaml.safe_load,
# path
'basename': os.path.basename,
'dirname': os.path.dirname,
}