Commit 76213591 by Robert Parrott

fix handling of [DEFAULT] section by ConfigParser. it is there by DEFAULT.

parent 35a3419b
...@@ -116,10 +116,10 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese ...@@ -116,10 +116,10 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
pass pass
if state == 'present': if state == 'present':
if cp.has_section(section) == False: if cp.has_section(section) == False:
if section.upper() == 'DEFAULT':
module.fail_json(msg="[DEFAULT] is an illegal section name")
if section.upper() != 'DEFAULT':
cp.add_section(section) cp.add_section(section)
changed = True changed = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment