From 46b5d0f533e8c740b94d64699dfb32d8f356cabd Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Fri, 13 Oct 2017 16:32:52 +0200
Subject: [PATCH] library/ipanss.py: Add standard_logging_setup call to fix
 logger.error behaviour

If the client name is not resolvable, the call of client_dns will internally
result in a logger.error call for the failed update of the DNS records.

The call to standard_logging_setup is fixing the behaviour to bremore like
a debug call.
---
 library/ipanss.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/library/ipanss.py b/library/ipanss.py
index ea47c532..ab725874 100644
--- a/library/ipanss.py
+++ b/library/ipanss.py
@@ -98,6 +98,7 @@ import time
 import gssapi
 import tempfile
 import inspect
+import logging
 
 from ansible.module_utils.basic import AnsibleModule
 from ipapython.version import NUM_VERSION, VERSION
@@ -127,6 +128,7 @@ from ipaplatform.paths import paths
 from ipaplatform.tasks import tasks
 from ipapython import certdb, ipautil
 from ipapython.ipautil import CalledProcessError
+from ipapython.ipa_log_manager import standard_logging_setup
 
 try:
     from ipaclient.install.client import CCACHE_FILE, client_dns, configure_certmonger, update_ssh_keys, configure_openldap_conf, hardcode_ldap_server, get_certs_from_ldap, save_state, disable_ra, create_ipa_nssdb
@@ -196,8 +198,10 @@ def main():
 
     fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
     statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
-
-    ###########################################################################
+    logger = logging.getLogger("ipa-client-install")
+    standard_logging_setup(
+        paths.IPACLIENT_INSTALL_LOG, verbose=True, debug=False,
+        filemode='a', console_format='%(message)s')
 
     os.environ['KRB5CCNAME'] = CCACHE_FILE
     
-- 
GitLab