diff options
author | Charles Zaffery <charleszaffery@gmail.com> | 2016-10-21 12:55:14 -0700 |
---|---|---|
committer | Michael Scherer <mscherer@users.noreply.github.com> | 2016-10-22 13:09:15 +0200 |
commit | 952ad58bda62c4014f6c5796b4750cb4467461f9 (patch) | |
tree | 62f0f26cbe5754b696433ce429cf135b34698057 | |
parent | 8d3a34ced677e065b6aebcef91bcd4afc521555f (diff) | |
download | ansible-modules-core-952ad58bda62c4014f6c5796b4750cb4467461f9.tar.gz |
Remove line when 'state: absent' with 'option:' instead of commenting
-rw-r--r-- | files/ini_file.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/files/ini_file.py b/files/ini_file.py index b66acd7e..68d72ca9 100644 --- a/files/ini_file.py +++ b/files/ini_file.py @@ -186,10 +186,10 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese else: index = index + 1 break - else: - # comment out the existing option line + elif state == 'absent': + # delete the existing line if match_active_opt(option, line): - ini_lines[index] = '#%s' % ini_lines[index] + del ini_lines[index] changed = True break |