mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ini_file: Match tabs before options (#28102)
This commit is contained in:
parent
5ee7862793
commit
93e1caccb7
1 changed files with 4 additions and 4 deletions
|
@ -126,16 +126,16 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
def match_opt(option, line):
|
def match_opt(option, line):
|
||||||
option = re.escape(option)
|
option = re.escape(option)
|
||||||
return re.match(' *%s( |\t)*=' % option, line) \
|
return re.match('( |\t)*%s( |\t)*=' % option, line) \
|
||||||
or re.match('# *%s( |\t)*=' % option, line) \
|
or re.match('#( |\t)*%s( |\t)*=' % option, line) \
|
||||||
or re.match('; *%s( |\t)*=' % option, line)
|
or re.match(';( |\t)*%s( |\t)*=' % option, line)
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# match_active_opt
|
# match_active_opt
|
||||||
|
|
||||||
def match_active_opt(option, line):
|
def match_active_opt(option, line):
|
||||||
option = re.escape(option)
|
option = re.escape(option)
|
||||||
return re.match(' *%s( |\t)*=' % option, line)
|
return re.match('( |\t)*%s( |\t)*=' % option, line)
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# do_ini
|
# do_ini
|
||||||
|
|
Loading…
Reference in a new issue