On 02/05/2014 10:14 AM, Petr Viktorin wrote:
Hello,
This fixes https://fedorahosted.org/freeipa/ticket/4135 in ipa-3-3. I'll
send a patch for master soon.


Version for master is here.


--
PetrĀ³
From 66c8303b8a10de81f30852cfe2923073c4c8c24f Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Wed, 5 Feb 2014 09:24:22 +0100
Subject: [PATCH] ipa tool: Print the name of the server we are connecting to
 with -v

The logging level for these messages was decreaed so that they
do not show up in ipa-advise output.
Reset the log level to INFO and configure ipa-advise to not display
INFO messages from xmlclient by default.

Partially reverts commit efe5a96725d3ddcd05b03a1ca9df5597eee693be

https://fedorahosted.org/freeipa/ticket/4135
---
 ipalib/rpc.py            | 6 +++---
 ipaserver/advise/base.py | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 3d6cc3f2cf90384bb29a7f002415abe93e43562e..2b47d1c0e25bbeec0dde38089f444e0399e1670e 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -746,7 +746,7 @@ def create_connection(self, ccache=None, verbose=False, fallback=True,
             else:
                 transport_class = LanguageAwareTransport
             kw['transport'] = transport_class(protocol=self.protocol)
-            self.log.debug('trying %s' % url)
+            self.log.info('trying %s' % url)
             setattr(context, 'request_url', url)
             serverproxy = self.server_proxy_class(url, **kw)
             if len(urls) == 1:
@@ -828,8 +828,8 @@ def forward(self, name, *args, **kw):
                 '%s.forward(): %r not in api.Command' % (self.name, name)
             )
         server = getattr(context, 'request_url', None)
-        self.debug("Forwarding '%s' to %s server '%s'",
-                   name, self.protocol, server)
+        self.log.info("Forwarding '%s' to %s server '%s'",
+                      name, self.protocol, server)
         command = getattr(self.conn, name)
         params = [args, kw]
         try:
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py
index abaf708dc64778e7e97d0cdcd166e8ec24902176..3f57f357e5c3b4bb0d8fa67bbdec10e79a69fe11 100644
--- a/ipaserver/advise/base.py
+++ b/ipaserver/advise/base.py
@@ -22,6 +22,7 @@
 from ipalib.errors import ValidationError
 from ipapython import admintool
 from textwrap import wrap
+from ipapython.ipa_log_manager import log_mgr
 
 
 """
@@ -173,6 +174,10 @@ def run(self):
 
         api.bootstrap(in_server=False, context='advise')
         api.finalize()
+        if not self.options.verbose:
+            # Do not print connection information by default
+            logger_name = r'ipa\.ipalib\.plugins\.rpcclient'
+            log_mgr.configure(dict(logger_regexps=[(logger_name, 'warning')]))
 
         # With no argument, print the list out and exit
         if not self.args:
-- 
1.8.5.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to