Fix UnicodeDecodeError from pexpect when ansible-playbook output contains unicode.

This commit is contained in:
Chris Church
2014-07-23 20:03:47 -04:00
parent 074b882714
commit 20d76bfc91
4 changed files with 15 additions and 13 deletions

View File

@@ -180,7 +180,7 @@ class BaseTestMixin(object):
handle, playbook_path = tempfile.mkstemp(suffix='.yml',
dir=project_dir)
test_playbook_file = os.fdopen(handle, 'w')
test_playbook_file.write(playbook_content)
test_playbook_file.write(playbook_content.encode('utf-8'))
test_playbook_file.close()
# Role playbooks are specified as a dict of role name and the
# content of tasks/main.yml playbook.