mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 21:54: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))
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue