1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

This commit is contained in:
Robert Parrott 2013-10-10 09:01:00 -04:00
parent 35a3419bee
commit 762135915c

View file

@ -116,11 +116,11 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
pass
if state == 'present':
if cp.has_section(section) == False:
if section.upper() == 'DEFAULT':
module.fail_json(msg="[DEFAULT] is an illegal section name")
cp.add_section(section)
if cp.has_section(section) == False:
if section.upper() != 'DEFAULT':
cp.add_section(section)
changed = True
if option is not None and value is not None: