From 6b0cf1e77745b131223ad4b52ccad66c2ee06b81 Mon Sep 17 00:00:00 2001
From: Sergio Oliveira Campos <seocam@redhat.com>
Date: Sat, 25 Apr 2020 19:06:27 -0300
Subject: [PATCH] Doc string improvements

---
 plugins/module_utils/ansible_freeipa_module.py | 13 ++++++++++---
 roles/ipaclient/library/ipaclient_get_otp.py   |  6 +++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py
index 81eeff83..7c295628 100644
--- a/plugins/module_utils/ansible_freeipa_module.py
+++ b/plugins/module_utils/ansible_freeipa_module.py
@@ -63,7 +63,7 @@ if six.PY3:
 
 
 def valid_creds(module, principal):  # noqa
-    """Get valid credintials matching the princial, try GSSAPI first."""
+    """Get valid credentials matching the princial, try GSSAPI first."""
     if "KRB5CCNAME" in os.environ:
         ccache = os.environ["KRB5CCNAME"]
         module.debug('KRB5CCNAME set to %s' % ccache)
@@ -127,7 +127,14 @@ def temp_kdestroy(ccache_dir, ccache_name):
 
 
 def api_connect(context=None):
-    """Create environment, initialize api and connect to ldap2."""
+    """
+    Initialize IPA API with the provided context.
+
+    `context` can be any of:
+        * `server` (default)
+        * `ansible-freeipa`
+        * `cli_installer`
+    """
     env = Env()
     env._bootstrap()
     env._finalize_core(**dict(DEFAULT_CONFIG))
@@ -159,7 +166,7 @@ def api_command_no_name(module, command, args):
 
 
 def api_check_param(command, name):
-    """Return if param exists in command param list."""
+    """Check if param exists in command param list."""
     return name in api.Command[command].params
 
 
diff --git a/roles/ipaclient/library/ipaclient_get_otp.py b/roles/ipaclient/library/ipaclient_get_otp.py
index 93734295..03e8b2b0 100644
--- a/roles/ipaclient/library/ipaclient_get_otp.py
+++ b/roles/ipaclient/library/ipaclient_get_otp.py
@@ -135,7 +135,7 @@ if six.PY3:
 
 def get_host_diff(ipa_host, module_host):
     """
-    Compare two host dicts and builds a dict of differences.
+    Build a dict with the differences from two host dicts.
 
     :param ipa_host: the host structure seen from IPA
     :param module_host: the target host structure seen from the module params
@@ -188,7 +188,7 @@ def get_module_host(module):
 
 def ensure_host_present(module, api, ipahost):
     """
-    Ensure that the host exists in IPA and has the same attributes.
+    Ensure host exists in IPA and has the same attributes.
 
     :param module: the ansible module
     :param api: IPA api handle
@@ -245,7 +245,7 @@ def ensure_host_present(module, api, ipahost):
 
 def ensure_host_absent(module, api, host):
     """
-    Ensure that the host does not exist in IPA.
+    Ensure host does not exist in IPA.
 
     :param module: the ansible module
     :param api: the IPA API handle
-- 
GitLab