From 4a532fb60ce865eebdbb7c2bd427a7d45023e8c2 Mon Sep 17 00:00:00 2001 From: Lukas Grossar Date: Fri, 1 Jul 2016 00:15:49 +0200 Subject: [PATCH] also match on tabs in ini_file (fixes #106) (#4067) also match on tabs in ini_file --- 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 223ab75c00..fd0ed47495 100644 --- a/lib/ansible/modules/files/ini_file.py +++ b/lib/ansible/modules/files/ini_file.py @@ -109,16 +109,16 @@ import os def match_opt(option, line): option = re.escape(option) - return re.match('%s *=' % option, line) \ - or re.match('# *%s *=' % option, line) \ - or re.match('; *%s *=' % option, line) + return re.match('%s( |\t)*=' % option, line) \ + or re.match('# *%s( |\t)*=' % option, line) \ + or re.match('; *%s( |\t)*=' % option, line) # ============================================================== # match_active_opt def match_active_opt(option, line): option = re.escape(option) - return re.match('%s *=' % option, line) + return re.match('%s( |\t)*=' % option, line) # ============================================================== # do_ini