Fixed escaping.

This commit is contained in:
Joshua Harlow 2012-02-03 20:15:40 -08:00
parent 185d83c143
commit 08ed6ff3a1

View File

@ -65,8 +65,12 @@ OS_AUTH_PORT = 5000
def write_env(name, value, fh):
escaped_val = subprocess.list2cmdline([str(value)])
fh.write("%s=%s" % (name, escaped_val))
str_value = str(value)
escaped_val = subprocess.list2cmdline([str_value])
if str_value != escaped_val:
fh.write("%s=\"%s\"" % (name, escaped_val))
else:
fh.write("%s=%s" % (name, str_value))
fh.write(os.linesep)