Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we

can remove the legacy system at a later date.
This commit is contained in:
Michael DeHaan
2013-04-10 17:52:35 -04:00
parent 804056a563
commit b09ef21ec9
13 changed files with 102 additions and 61 deletions

View File

@@ -24,6 +24,7 @@ import os
import ansible.playbook
import ansible.constants as C
import ansible.utils.template
from ansible import errors
from ansible import callbacks
from ansible import utils
@@ -180,6 +181,11 @@ def main(args):
pb.run()
if ansible.utils.template.Flags.LEGACY_TEMPLATE_WARNING:
print callbacks.banner("Deprecation Warnings")
print " legacy playbook variable references such as '$foo' will be removed in Ansible 1.4"
print " update playbooks to use '{{ foo }}' instead"
hosts = sorted(pb.stats.processed.keys())
print callbacks.banner("PLAY RECAP")
playbook_cb.on_stats(pb.stats)
@@ -202,6 +208,7 @@ def main(args):
colorize('changed', t['changed'], 'yellow'),
colorize('unreachable', t['unreachable'], 'red'),
colorize('failed', t['failures'], 'red'))
print ""
if len(failed_hosts) > 0:
@@ -211,7 +218,6 @@ def main(args):
print >>sys.stderr, "ERROR: %s" % e
return 1
return 0