diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2015-11-02 09:00:56 -0500 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2015-11-02 09:00:56 -0500 |
commit | 79bf66336b8841052c0e14f744995b97e08dfe3b (patch) | |
tree | e6118e0647e2fb722b58d9b7648d81adfd2db946 | |
parent | 467c29e3dbe4f29302d1277f35ed8854004833ea (diff) | |
download | ansible-79bf66336b8841052c0e14f744995b97e08dfe3b.tar.gz |
switched clean_data from hardcoded delimiters to actual currently set jinja2 environment delimiters
-rw-r--r-- | lib/ansible/template/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ansible/template/__init__.py b/lib/ansible/template/__init__.py index b7a0ea7c87..6226ee66ca 100644 --- a/lib/ansible/template/__init__.py +++ b/lib/ansible/template/__init__.py @@ -232,18 +232,18 @@ class Templar: elif token[1] == self.variable_end[1]: prev_idx = None - if token == '%}' and block_openings: + if token == self.block_end and block_openings: prev_idx = block_openings.pop() - elif token == '}}' and print_openings: + elif token == self.variable_end and print_openings: prev_idx = print_openings.pop() if prev_idx is not None: # replace the opening data.seek(prev_idx, os.SEEK_SET) - data.write('{#') + data.write(self.environment.comment_start_string) # replace the closing data.seek(token_start, os.SEEK_SET) - data.write('#}') + data.write(self.environment.comment_end_string) else: raise AnsibleError("Error while cleaning data for safety: unhandled regex match") |