mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-07 14:44:22 -07:00
regexp Error
This commit is contained in:
parent
37bd9a51dc
commit
acfc096a28
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue