Merge pull request #2620 from willthames/shlex_split_bug

Test case and fix for shlex.split unicode bug
pull/2622/head
Michael DeHaan 12 years ago
commit 586ee923a6

@ -194,7 +194,7 @@ class Play(object):
task_vars['_original_file'] = original_file
if 'include' in x:
tokens = shlex.split(x['include'])
tokens = shlex.split(str(x['include']))
items = ['']
included_additional_conditions = list(additional_conditions)
for k in x:

@ -211,6 +211,27 @@ class TestPlaybook(unittest.TestCase):
assert utils.jsonify(expected, format=True) == utils.jsonify(actual,format=True)
def test_task_includes(self):
pb = os.path.join(self.test_dir, 'task-includer.yml')
actual = self._run(pb)
# if different, this will output to screen
print "**ACTUAL**"
print utils.jsonify(actual, format=True)
expected = {
"localhost": {
"changed": 0,
"failures": 0,
"ok": 1,
"skipped": 0,
"unreachable": 0
}
}
print "**EXPECTED**"
print utils.jsonify(expected, format=True)
assert utils.jsonify(expected, format=True) == utils.jsonify(actual,format=True)
def test_playbook_vars(self):
test_callbacks = TestCallbacks()
playbook = ansible.playbook.PlayBook(

@ -0,0 +1,2 @@
---
- action: debug msg="$internal"

@ -0,0 +1,9 @@
---
- hosts: all
connection: local
gather_facts: no
vars:
- internal: xyz
tasks:
- include: task-included.yml internal=$internal
Loading…
Cancel
Save