Skip to content

Commit a98d845

Browse files
committed
switch from \" to '"' in shell lines
Otherwise the parser in ansible-git will bug out with Traceback (most recent call last): File "command", line 2285, in <module> main() File "command", line 226, in main rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell) File "command", line 1928, in run_command to_clean_args = shlex.split(b_args) File "/usr/lib/python2.7/shlex.py", line 279, in split return list(lex) File "/usr/lib/python2.7/shlex.py", line 269, in next token = self.get_token() File "/usr/lib/python2.7/shlex.py", line 96, in get_token raw = self.read_token() File "/usr/lib/python2.7/shlex.py", line 172, in read_token raise ValueError, "No closing quotation" ValueError: No closing quotation Thanks to @mgedmin in #ansible for the fix
1 parent faaa5e2 commit a98d845

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tasks/check_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# determine which Java version is installed
4040

4141
- name: if Java is installed, check version
42-
shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F \" '{ print $2 }'
42+
shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F '"' '{ print $2 }'
4343
when: oracle_java_installed
4444
register: oracle_java_task_version
4545
changed_when: False

tests/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
when: oracle_java_version_installed != expected_java_version
2626

2727
- name: register result_java_version with host installed Java version
28-
shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F \" '{ print $2 }'
28+
shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F '"' '{ print $2 }'
2929
register: result_java_version
3030
changed_when: no
3131

0 commit comments

Comments
 (0)