From 09a2ae5368abce22e397fef29d3acf3c16b8b96c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 5 Feb 2014 09:24:22 +0100 Subject: [PATCH 43/46] ipa tool: Print the name of the server we are connecting to with -v MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Tomáš Babej --- ipalib/rpc.py | 4 ++-- ipaserver/advise/base.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 81e7aa35fdf780b3dcd850cfcc3ba5285d71e461..1eec1134617dd49395c2b36f11f304c473067a5d 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -621,7 +621,7 @@ def create_connection(self, ccache=None, verbose=False, fallback=True, kw['transport'] = KerbTransport() else: kw['transport'] = LanguageAwareTransport() - self.log.debug('trying %s' % url) + self.log.info('trying %s' % url) setattr(context, 'request_url', url) serverproxy = ServerProxy(url, **kw) if len(urls) == 1: @@ -697,7 +697,7 @@ 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 server '%s'", name, server) + self.log.info("Forwarding '%s' to server '%s'", name, server) command = getattr(self.conn, name) params = [args, kw] try: diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py index 92dbb4e9e30c6d624eca95609568ae62bd9ea7fe..056cb808d24805202f16b4afd60356163ca9006a 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\.rpc\.xmlclient' + 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