Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basename and dirname to the core jinja2 filters #2978

Merged
merged 1 commit into from
May 25, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/ansible/runner/filter_plugins/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import base64
import json
import os.path
import yaml

def to_nice_yaml(*a, **kw):
Expand Down Expand Up @@ -45,5 +46,9 @@ def filters(self):
'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,
}