mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
apache.config: correctly output a list of the Options
This commit is contained in:
parent
376bec0455
commit
64a9442e38
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue