From 93e1caccb7f4aa107de0bee4d8ed317df0300420 Mon Sep 17 00:00:00 2001 From: "T. Miller" Date: Sat, 12 Aug 2017 02:17:25 -0500 Subject: [PATCH] ini_file: Match tabs before options (#28102) --- lib/ansible/modules/files/ini_file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/files/ini_file.py b/lib/ansible/modules/files/ini_file.py index 812abc6f9f0..42894d80fb2 100644 --- a/lib/ansible/modules/files/ini_file.py +++ b/lib/ansible/modules/files/ini_file.py @@ -126,16 +126,16 @@ from ansible.module_utils.basic import AnsibleModule def match_opt(option, line): option = re.escape(option) - return re.match(' *%s( |\t)*=' % option, line) \ - or re.match('# *%s( |\t)*=' % option, line) \ - or re.match('; *%s( |\t)*=' % option, line) + return re.match('( |\t)*%s( |\t)*=' % option, line) \ + or re.match('#( |\t)*%s( |\t)*=' % option, line) \ + or re.match(';( |\t)*%s( |\t)*=' % option, line) # ============================================================== # match_active_opt def match_active_opt(option, line): option = re.escape(option) - return re.match(' *%s( |\t)*=' % option, line) + return re.match('( |\t)*%s( |\t)*=' % option, line) # ============================================================== # do_ini