apache.config: correctly output a list of the Options

This commit is contained in:
Denys Havrysh 2016-06-27 12:05:03 +03:00
parent 376bec0455
commit 64a9442e38

View file

@ -404,14 +404,13 @@ def _parse_config(conf, slot=None):
else:
print('{0}'.format(conf), file=ret, end='')
elif isinstance(conf, list):
for value in conf:
print(_parse_config(value, str(slot)), file=ret)
print('{0} {1}'.format(slot, ' '.join(conf)), file=ret, end='')
elif isinstance(conf, dict):
print('<{0} {1}>'.format(
slot,
_parse_config(conf['this'])),
file=ret
)
file=ret
)
del conf['this']
for key, value in six.iteritems(conf):
if isinstance(value, str):
@ -452,6 +451,6 @@ def config(name, config, edit=True):
configs = _parse_config(entry[key], key)
if edit:
with salt.utils.fopen(name, 'w') as configfile:
configfile.write('# This file is managed by saltstack.\n')
configfile.write('# This file is managed by Salt.\n')
configfile.write(configs)
return configs