Merge pull request #4428 from robparrott/devel

Properly handle DEFAULT section with ConfigParser in ini_file modules
reviewable/pr18780/r1
jctanner 11 years ago
commit 94fac29bf7

@ -116,9 +116,9 @@ 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 section.upper() == 'DEFAULT': # DEFAULT section is always there by DEFAULT, so never try to add it.
module.fail_json(msg="[DEFAULT] is an illegal section name") if cp.has_section(section) == False and section.upper() != 'DEFAULT':
cp.add_section(section) cp.add_section(section)
changed = True changed = True

Loading…
Cancel
Save