From 709ffda3d194978c01e2fc216e7de29da061289f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 11 Oct 2013 19:12:25 -0400 Subject: [PATCH] Tweak only_if deprecation detector. --- lib/ansible/playbook/task.py | 2 +- test/playbook1.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index 34945704f89..ebad7e7f6c5 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -182,7 +182,7 @@ class Task(object): # load various attributes self.only_if = ds.get('only_if', 'True') - if self.only_if != True: + if self.only_if != 'True': utils.deprecated("only_if is a very old feature and has been obsolete since 0.9, please switch to the 'when' conditional as described at http://ansibleworks.com/docs","1.5") self.when = ds.get('when', None) diff --git a/test/playbook1.yml b/test/playbook1.yml index 2969a93db80..6a75df52f8a 100644 --- a/test/playbook1.yml +++ b/test/playbook1.yml @@ -14,7 +14,7 @@ vars_files: - common_vars.yml - - [ '$facter_operatingsystem.yml', 'default_os.yml' ] + - [ '{{facter_operatingsystem.yml}}', 'default_os.yml' ] tasks: @@ -25,10 +25,10 @@ action: command true - name: test basic shell, plus two ways to dereference a variable - action: shell echo $HOME $port + action: shell echo $HOME {{port}} - name: test vars_files imports - action: shell echo $duck $cow $testing + action: shell echo {{duck}} {{cow}} {{testing}} # in the command below, the test file should contain a valid template # and trigger the change handler @@ -42,7 +42,7 @@ # not be triggered twice because it's already triggered - name: test template - action: template src=$item dest=/tmp/ansible_test_data_template.out + action: template src={{item}} dest=/tmp/ansible_test_data_template.out first_available_file: - nonexistantfile - sample.j2 @@ -60,7 +60,7 @@ # the following command should be skipped - name: this should be skipped - action: shell echo 'if you see this, this is wrong ($facter_operatingsystem)' + action: shell echo 'if you see this, this is wrong' when: 2 == 3 handlers: