fix strings with spaces not being handled properly

This commit is contained in:
Jorge Schrauwen 2016-02-01 21:56:54 +00:00
parent 47f3ee48b4
commit f8166ccb52

View File

@ -142,6 +142,8 @@ def _write_config(config):
with salt.utils.atomicfile.atomic_open('/usbkey/config', 'w') as config_file:
config_file.write("#\n# This file was generated by salt\n#\n")
for prop in OrderedDict(sorted(config.items())):
if ' ' in config[prop] and not config[prop].startswith('"'):
config[prop] = '"{0}"'.format(config[prop])
config_file.write("{0}={1}\n".format(prop, config[prop]))
log.debug('smartos.config - wrote /usbkey/config: {0}'.format(config))
except IOError: