saltstack/salt — pull request #11042 by olliewalsh (2014-03-07 17:46:14+00:00)
Title: Fix misuse of !r string formatting when building command line strings/lists

Where cli strings are being used then use single quotes:
You want to run `mkdir '/foo\ bar'` not `mkdir '/foo\\ bar'.

Where cli lists are being used then don't quote at all, subprocess handles this already:

>>> subprocess.list2cmdline(['mkdir', 'foo\ bar'])
'mkdir "foo\\ bar"'

I've left all log/error/exception messages as is.