commit
e03a724dc0
2 changed files with 8 additions and 1 deletions
|
@ -295,7 +295,7 @@ def parse_kv(args):
|
||||||
vargs = shlex.split(args, posix=True)
|
vargs = shlex.split(args, posix=True)
|
||||||
for x in vargs:
|
for x in vargs:
|
||||||
if x.find("=") != -1:
|
if x.find("=") != -1:
|
||||||
k, v = x.split("=")
|
k, v = x.split("=", 1)
|
||||||
options[k]=v
|
options[k]=v
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
|
@ -235,3 +235,10 @@ class TestUtils(unittest.TestCase):
|
||||||
res = ansible.utils.template(template, vars, {}, no_engine=False)
|
res = ansible.utils.template(template, vars, {}, no_engine=False)
|
||||||
|
|
||||||
assert res == u'hello wórld'
|
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'})
|
||||||
|
|
Loading…
Reference in a new issue