Просмотр исходного кода

Account for unexpected comments in config parsing util.

Nashwan Azhari 6 лет назад
Родитель
Сommit
1d747d7d7d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      coriolis/utils.py

+ 1 - 1
coriolis/utils.py

@@ -654,7 +654,7 @@ def parse_ini_config(file_contents):
     returns a dict with the options/values within it.
     """
     config = {}
-    regex_expr = '(.*[^-\\s])\\s*=\\s*(?:"|\')?([^"\']*)(?:"|\')?\\s*'
+    regex_expr = '([^#]*[^-\\s#])\\s*=\\s*(?:"|\')?([^#"\']*)(?:"|\')?\\s*'
     for config_line in file_contents.splitlines():
         m = re.match(regex_expr, config_line)
         if m: