mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
fix handling of [DEFAULT] section by ConfigParser. it is there by DEFAULT.
This commit is contained in:
parent
35a3419bee
commit
762135915c
1 changed files with 4 additions and 4 deletions
|
@ -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 section.upper() == 'DEFAULT':
|
|
||||||
module.fail_json(msg="[DEFAULT] is an illegal section name")
|
|
||||||
|
|
||||||
|
if cp.has_section(section) == False:
|
||||||
|
|
||||||
|
if section.upper() != 'DEFAULT':
|
||||||
cp.add_section(section)
|
cp.add_section(section)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue