Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
6d94ae64
Commit
6d94ae64
authored
Aug 04, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary unicode conversions from parse_kv
Fixes #8425
parent
642b183f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
4 deletions
+3
-4
lib/ansible/runner/__init__.py
+0
-1
lib/ansible/utils/__init__.py
+0
-3
test/integration/unicode.yml
+1
-0
test/units/TestUtils.py
+2
-0
No files found.
lib/ansible/runner/__init__.py
View file @
6d94ae64
...
...
@@ -31,7 +31,6 @@ import sys
import
pipes
import
jinja2
import
subprocess
import
shlex
import
getpass
import
ansible.constants
as
C
...
...
lib/ansible/utils/__init__.py
View file @
6d94ae64
...
...
@@ -694,8 +694,6 @@ def parse_kv(args):
''' convert a string of key/value items to a dict '''
options
=
{}
if
args
is
not
None
:
# attempting to split a unicode here does bad things
args
=
args
.
encode
(
'utf-8'
)
try
:
vargs
=
split_args
(
args
)
except
ValueError
,
ve
:
...
...
@@ -703,7 +701,6 @@ def parse_kv(args):
raise
errors
.
AnsibleError
(
"error parsing argument string, try quoting the entire line."
)
else
:
raise
vargs
=
[
x
.
decode
(
'utf-8'
)
for
x
in
vargs
]
for
x
in
vargs
:
if
"="
in
x
:
k
,
v
=
x
.
split
(
"="
,
1
)
...
...
test/integration/unicode.yml
View file @
6d94ae64
...
...
@@ -40,3 +40,4 @@
gather_facts
:
true
tasks
:
-
debug
:
msg='Unicode is a good thing ™'
-
debug
:
msg=АБВГД
test/units/TestUtils.py
View file @
6d94ae64
...
...
@@ -165,6 +165,8 @@ class TestUtils(unittest.TestCase):
def
test_parse_kv_basic
(
self
):
self
.
assertEqual
(
ansible
.
utils
.
parse_kv
(
'a=simple b="with space" c="this=that"'
),
{
'a'
:
'simple'
,
'b'
:
'with space'
,
'c'
:
'this=that'
})
self
.
assertEqual
(
ansible
.
utils
.
parse_kv
(
'msg=АБВГД'
),
{
'msg'
:
'АБВГД'
})
def
test_jsonify
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment