Triple quoting does not work on command lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
satori |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
The code at https:/
command = 'echo -e """%s""" | python' % platform_command
As far as I can see, this string is then passed to the remote host for execution. The problem is see is that shells don't do triple quoting like Python. What happens instead is that the first pair of quotes become an empty string and disappears. The second set of quotes quote the Python code and the third pair of quotes also disappear:
$ python -c 'import sys; print sys.argv' """x "foo" y"""
['-c', 'x foo y']
The embedded Python code should probably be backslash-escaped properly instead. I think the misleading quotes should be removed in any case.
https:/ /review. openstack. org/141060/