regexp Error

This commit is contained in:
Yousefnezhad 2025-06-11 11:22:27 +03:30
commit acfc096a28

View file

@ -80,14 +80,14 @@ def get_exports(module, output_format, file_path="/etc/exports"):
module.fail_json(msg="Could not read {}".format(file_path)) module.fail_json(msg="Could not read {}".format(file_path))
exports = {} exports = {}
pattern = r'\s*(\S+)\s+(.+)' pattern = re.compile(r'\s*(\S+)\s+(.+)')
for line in output_lines: for line in output_lines:
line = line.strip() line = line.strip()
if not line or line.startswith('#'): if not line or line.startswith('#'):
continue continue
match = re.match(pattern, line) match = pattern.match(line)
if not match: if not match:
continue continue