From 8d357942f9ebaf45f51b3043d130a706db9b928d Mon Sep 17 00:00:00 2001 From: Yousefnezhad Date: Mon, 16 Jun 2025 07:56:00 +0330 Subject: [PATCH] Blanks --- plugins/modules/nfs_exports_info.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/modules/nfs_exports_info.py b/plugins/modules/nfs_exports_info.py index eb20bc17cc..f9ded05a41 100644 --- a/plugins/modules/nfs_exports_info.py +++ b/plugins/modules/nfs_exports_info.py @@ -72,7 +72,7 @@ import hashlib def get_exports(module, output_format, file_path="/etc/exports"): IP_ENTRY_PATTERN = re.compile(r'(\d+\.\d+\.\d+\.\d+)\(([^)]+)\)') MAIN_LINE_PATTERN = re.compile(r'\s*(\S+)\s+(.+)') - + file_digests = {} hash_algorithms = ['sha256', 'sha1', 'md5'] @@ -99,7 +99,7 @@ def get_exports(module, output_format, file_path="/etc/exports"): except Exception as ex: module.warn("Error calculating '{}' hash: {}".format(algo, ex)) exports = {} - + output_lines = [] if file_content_bytes: output_lines = file_content_bytes.decode('utf-8', errors='ignore').splitlines() @@ -110,7 +110,7 @@ def get_exports(module, output_format, file_path="/etc/exports"): match = MAIN_LINE_PATTERN.match(line) if not match: continue - + folder = match.group(1) rest = match.group(2) @@ -132,11 +132,13 @@ def get_exports(module, output_format, file_path="/etc/exports"): return { 'exports_info': exports, - 'file_digest': file_digests # <--- Returning the dictionary of hashes + 'file_digest': file_digests } except Exception as e: module.fail_json(msg="Error while processing exports: {}".format(e)) + + def main(): module = AnsibleModule( argument_spec=dict(