From 6caa58e8be48f0b96f29a1dacc53ab7664d6c212 Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Mon, 22 Apr 2024 17:07:03 +0200
Subject: [PATCH] ansible_freeipa_module: Import and provide
 normalize_sshpubkey

normalize_sshpubkey is imported from ipalib.util and also added to
__all__ for use in modules.
---
 plugins/module_utils/ansible_freeipa_module.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py
index 51c02c73..16b4fa81 100644
--- a/plugins/module_utils/ansible_freeipa_module.py
+++ b/plugins/module_utils/ansible_freeipa_module.py
@@ -31,7 +31,7 @@ __all__ = ["gssapi", "netaddr", "api", "ipalib_errors", "Env",
            "paths", "tasks", "get_credentials_if_valid", "Encoding",
            "DNSName", "getargspec", "certificate_loader",
            "write_certificate_list", "boolean", "template_str",
-           "urlparse"]
+           "urlparse", "normalize_sshpubkey"]
 
 import os
 # ansible-freeipa requires locale to be C, IPA requires utf-8.
@@ -157,6 +157,8 @@ try:
     except ImportError:
         from ansible.module_utils.six.moves.urllib.parse import urlparse
 
+    from ipalib.util import normalize_sshpubkey
+
 except ImportError as _err:
     ANSIBLE_FREEIPA_MODULE_IMPORT_ERROR = str(_err)
 
-- 
GitLab