From 5b0b1f8da6d713410037584679ebe99a0ce099f7 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 6 Jul 2015 14:12:10 -0700 Subject: [PATCH] unquote strings in the ansible config file --- lib/ansible/constants.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index a771fe42c2..55bfd43f13 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -22,10 +22,12 @@ __metaclass__ = type import os import pwd import sys - -from six.moves import configparser from string import ascii_letters, digits +from six import string_types +from six.moves import configparser + +from ansible.parsing.splitter import unquote from ansible.errors import AnsibleOptionsError # copied from utils, avoid circular reference fun :) @@ -49,8 +51,10 @@ def get_config(p, section, key, env_var, default, boolean=False, integer=False, elif floating: value = float(value) elif islist: - if isinstance(value, basestring): + if isinstance(value, string_types): value = [x.strip() for x in value.split(',')] + elif isinstance(value, string_types): + value = unquote(value) return value def _get_config(p, section, key, env_var, default):