From ebb3b675ade348f52d3e0260bda3c0df843108c9 Mon Sep 17 00:00:00 2001 From: Neha Alhat Date: Wed, 6 Jun 2018 15:14:23 +0530 Subject: [PATCH] Remove initialization of logger if logger is None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If default_log_level=keystoneauth=WARN is enabled in nova.conf, then these log messages [1][2][3] are logged using cinderclient.v3.client logger name instead of keystoneauth.session. This is because cinderclient initializes logger if not passed by nova and since debug=True is set in nova.conf it’s uses root logger log level. This patch removes initialization of logger code to ensure log messages[1][2][3] are logged only when keystoneauth=DEBUG is enabled in nova.conf. This will also enable us to consume split_logger config option [4] when enabled in nova without making any additional changes in client code. [1] REQ: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@391 [2] RESP: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@422 [3] RESP BODY: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@454 [4] https://review.openstack.org/#/c/568878/ Change-Id: I937c6ac2f6e254c438ee2f36eb6c291f62c0f411 --- cinderclient/v3/client.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cinderclient/v3/client.py b/cinderclient/v3/client.py index 5eb526897..c1e8877a3 100644 --- a/cinderclient/v3/client.py +++ b/cinderclient/v3/client.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -import logging - from cinderclient import api_versions from cinderclient import client from cinderclient.v3 import attachments @@ -112,9 +110,6 @@ class Client(object): setattr(self, extension.name, extension.manager_class(self)) - if not logger: - logger = logging.getLogger(__name__) - self.client = client._construct_http_client( username=username, password=password,