diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-02-02 23:12:16 +0100 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-02-02 23:12:16 +0100 |
commit | 5b279c1c15fef88497d3806192da5d5024ebcc7e (patch) | |
tree | 2c789df37fa3d7e4ca50a102bdecf5aa75cab3f4 /bin | |
parent | Make extra_vars into unicode string type early (diff) | |
download | ansible-5b279c1c15fef88497d3806192da5d5024ebcc7e.tar.xz ansible-5b279c1c15fef88497d3806192da5d5024ebcc7e.zip |
Fix for v1 handling of unicode extra-vars
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible-playbook | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook index af69ed9386..c3ceab9b27 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -47,6 +47,7 @@ import ansible.utils.template from ansible import errors from ansible import callbacks from ansible import utils +from ansible.utils import to_unicode from ansible.color import ANSIBLE_COLOR, stringc from ansible.callbacks import display @@ -144,10 +145,11 @@ def main(args): extra_vars = {} for extra_vars_opt in options.extra_vars: - if extra_vars_opt.startswith("@"): + extra_vars_opt = to_unicode(extra_vars_opt) + if extra_vars_opt.startswith(u"@"): # Argument is a YAML file (JSON is a subset of YAML) extra_vars = utils.combine_vars(extra_vars, utils.parse_yaml_from_file(extra_vars_opt[1:], vault_password=vault_pass)) - elif extra_vars_opt and extra_vars_opt[0] in '[{': + elif extra_vars_opt and extra_vars_opt[0] in u'[{': # Arguments as YAML extra_vars = utils.combine_vars(extra_vars, utils.parse_yaml(extra_vars_opt)) else: |