Commit e03a724d by Michael DeHaan

Merge pull request #413 from emgee/kv-equals

Allow "=" in k-v values.
parents 90c70d7c 8babac48
......@@ -295,7 +295,7 @@ def parse_kv(args):
vargs = shlex.split(args, posix=True)
for x in vargs:
if x.find("=") != -1:
k, v = x.split("=")
k, v = x.split("=", 1)
options[k]=v
return options
......
......@@ -235,3 +235,10 @@ class TestUtils(unittest.TestCase):
res = ansible.utils.template(template, vars, {}, no_engine=False)
assert res == u'hello wórld'
#####################################
### key-value parsing
def test_parse_kv_basic(self):
assert (ansible.utils.parse_kv('a=simple b="with space" c="this=that"') ==
{'a': 'simple', 'b': 'with space', 'c': 'this=that'})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment