From 47f1d49690fe3787a356175a069723f33ca12cfd Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 16 Oct 2014 04:34:30 +0900 Subject: [PATCH] Do not log keystone token Previously token values are logged as DEBUG level when a new client object is instantiated. In other project and clients, token values are now not logged and is output as *REDACTED* instead. In Horizon these log lines do not have much meaning and we can simply remove them. Change-Id: I67617ac6424907574d79ec2a57b513a548e220d2 Closes-Bug: #1380642 --- openstack_dashboard/api/ceilometer.py | 2 -- openstack_dashboard/api/cinder.py | 2 -- openstack_dashboard/api/glance.py | 2 -- openstack_dashboard/api/heat.py | 2 -- openstack_dashboard/api/keystone.py | 1 - openstack_dashboard/api/neutron.py | 4 ---- openstack_dashboard/api/nova.py | 2 -- openstack_dashboard/api/swift.py | 2 -- openstack_dashboard/api/trove.py | 2 -- 9 files changed, 19 deletions(-) diff --git a/openstack_dashboard/api/ceilometer.py b/openstack_dashboard/api/ceilometer.py index bb161aaf4d..38a3b3a7b1 100644 --- a/openstack_dashboard/api/ceilometer.py +++ b/openstack_dashboard/api/ceilometer.py @@ -278,8 +278,6 @@ def ceilometerclient(request): endpoint = base.url_for(request, 'metering') insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) - LOG.debug('ceilometerclient connection created using token "%s" ' - 'and endpoint "%s"' % (request.user.token.id, endpoint)) return ceilometer_client.Client('2', endpoint, token=(lambda: request.user.token.id), insecure=insecure, diff --git a/openstack_dashboard/api/cinder.py b/openstack_dashboard/api/cinder.py index 734bacaa92..016aff3cab 100644 --- a/openstack_dashboard/api/cinder.py +++ b/openstack_dashboard/api/cinder.py @@ -160,8 +160,6 @@ def cinderclient(request): except exceptions.ServiceCatalogException: LOG.debug('no volume service configured.') raise - LOG.debug('cinderclient connection created using token "%s" and url "%s"' % - (request.user.token.id, cinder_url)) c = api_version['client'].Client(request.user.username, request.user.token.id, project_id=request.user.tenant_id, diff --git a/openstack_dashboard/api/glance.py b/openstack_dashboard/api/glance.py index a366a2f155..5667c0b25c 100644 --- a/openstack_dashboard/api/glance.py +++ b/openstack_dashboard/api/glance.py @@ -41,8 +41,6 @@ def glanceclient(request, version='1'): url = base.url_for(request, 'image') insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) - LOG.debug('glanceclient connection created using token "%s" and url "%s"' - % (request.user.token.id, url)) return glance_client.Client(version, url, token=request.user.token.id, insecure=insecure, cacert=cacert) diff --git a/openstack_dashboard/api/heat.py b/openstack_dashboard/api/heat.py index 358b94a1ee..9dd6beba3f 100644 --- a/openstack_dashboard/api/heat.py +++ b/openstack_dashboard/api/heat.py @@ -36,8 +36,6 @@ def heatclient(request, password=None): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) endpoint = base.url_for(request, 'orchestration') - LOG.debug('heatclient connection created using token "%s" and url "%s"' % - (request.user.token.id, endpoint)) kwargs = { 'token': request.user.token.id, 'insecure': insecure, diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index 43d72a58e7..3f536b8c75 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -160,7 +160,6 @@ def keystoneclient(request, admin=False): if (hasattr(request, cache_attr) and (not user.token.id or getattr(request, cache_attr).auth_token == user.token.id)): - LOG.debug("Using cached client for token: %s" % user.token.id) conn = getattr(request, cache_attr) else: endpoint = _get_endpoint_url(request, endpoint_type) diff --git a/openstack_dashboard/api/neutron.py b/openstack_dashboard/api/neutron.py index dbbe6e9c1a..d4b4861bd7 100644 --- a/openstack_dashboard/api/neutron.py +++ b/openstack_dashboard/api/neutron.py @@ -493,10 +493,6 @@ def get_ipver_str(ip_version): def neutronclient(request): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) - LOG.debug('neutronclient connection created using token "%s" and url "%s"' - % (request.user.token.id, base.url_for(request, 'network'))) - LOG.debug('user_id=%(user)s, tenant_id=%(tenant)s' % - {'user': request.user.id, 'tenant': request.user.tenant_id}) c = neutron_client.Client(token=request.user.token.id, auth_url=base.url_for(request, 'identity'), endpoint_url=base.url_for(request, 'network'), diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py index 8ee92f9961..973b96f513 100644 --- a/openstack_dashboard/api/nova.py +++ b/openstack_dashboard/api/nova.py @@ -419,8 +419,6 @@ class FloatingIpManager(network_base.FloatingIpManager): def novaclient(request): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) - LOG.debug('novaclient connection created using token "%s" and url "%s"' % - (request.user.token.id, base.url_for(request, 'compute'))) c = nova_client.Client(request.user.username, request.user.token.id, project_id=request.user.tenant_id, diff --git a/openstack_dashboard/api/swift.py b/openstack_dashboard/api/swift.py index a31c430d74..2805480fbe 100644 --- a/openstack_dashboard/api/swift.py +++ b/openstack_dashboard/api/swift.py @@ -110,8 +110,6 @@ def swift_api(request): endpoint = base.url_for(request, 'object-store') cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) - LOG.debug('Swift connection created using token "%s" and url "%s"' - % (request.user.token.id, endpoint)) return swiftclient.client.Connection(None, request.user.username, None, diff --git a/openstack_dashboard/api/trove.py b/openstack_dashboard/api/trove.py index 4a74581214..481442bbe4 100644 --- a/openstack_dashboard/api/trove.py +++ b/openstack_dashboard/api/trove.py @@ -30,8 +30,6 @@ def troveclient(request): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) trove_url = base.url_for(request, 'database') - LOG.debug('troveclient connection created using token "%s" and url "%s"' % - (request.user.token.id, trove_url)) c = client.Client(request.user.username, request.user.token.id, project_id=request.user.project_id,