URL: https://github.com/freeipa/freeipa/pull/937
Author: felipevolpone
 Title: #937: Configuring log handlers during the input parameters validation 
phase
Action: opened

PR body:
"""
Previously, a log handler would be configured only after all the input 
parameters be validated, as can be checked in 
`ipapython/admintool.py::AdminTool::main`. So, any call to 
`logger.[warning,info,error,debug]`, during that phase, doesn't work and it 
also raises an exception. 

Now, log handlers are setup before the input parameters validation phase.

Fixes: https://pagure.io/freeipa/issue/7071
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/937/head:pr937
git checkout pr937
From 8981dacfbe398ccd2f622d44cc2854ad2b893287 Mon Sep 17 00:00:00 2001
From: Felipe Volpone <fbarr...@redhat.com>
Date: Thu, 27 Jul 2017 09:20:25 -0300
Subject: [PATCH] Configuring log handlers during the input parameters
 validation phase

Previously, a log handler would be configured only after all the
input parameters be validated, as can be checked in
ipapython/admintool.py::AdminTool::main. So, any call to
logger.[warning,info,error,debug], during that phase, doesn't
work and it also raises an exception.

Now, log handlers are setup before the input parameters validation
phase.

https://pagure.io/freeipa/issue/7071
---
 ipapython/admintool.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ipapython/admintool.py b/ipapython/admintool.py
index 329e20f374..1ff5f3cf61 100644
--- a/ipapython/admintool.py
+++ b/ipapython/admintool.py
@@ -136,6 +136,8 @@ def main(cls, argv):
         :param argv: Command-line arguments.
         :return: Command exit code
         """
+        standard_logging_setup(None, verbose=True)
+
         if cls not in cls._option_parsers:
             # We use cls._option_parsers, a dictionary keyed on class, to check
             # if we need to create a parser. This is because cls.option_parser
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to