1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

regexp Error

This commit is contained in:
Yousefnezhad 2025-06-11 11:22:27 +03:30
parent 37bd9a51dc
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))
exports = {}
pattern = r'\s*(\S+)\s+(.+)'
pattern = re.compile(r'\s*(\S+)\s+(.+)')
for line in output_lines:
line = line.strip()
if not line or line.startswith('#'):
continue
match = re.match(pattern, line)
match = pattern.match(line)
if not match:
continue