瀏覽代碼

Changing python regex method from match to search due to variable content structure

Eric Wolinetz 7 年之前
父節點
當前提交
237b1e3736
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      roles/openshift_logging/library/logging_patch.py

+ 1 - 1
roles/openshift_logging/library/logging_patch.py

@@ -77,7 +77,7 @@ def account_for_whitelist(current_file_contents, new_file_contents, white_list=N
 
     for line in white_list:
         regex_line = r".*" + re.escape(line) + r":.*\n"
-        new_file_line = re.match(regex_line, new_file_contents)
+        new_file_line = re.search(regex_line, new_file_contents)
         if new_file_line:
             current_file_contents = re.sub(regex_line, new_file_line.group(0), current_file_contents)
         else: