Skip to content

Commit

Permalink
mongodb, db2: do not print full URL in logs
Browse files Browse the repository at this point in the history
The full URL used to connect to MongoDB or DB2 might contains sensitive
information such as username and password, so it's better to not print
it at all.
Instead, just print the hosts that are being connected to.

Fixes-Bug: #1244476

(cherry picked from commit f2e6511)

Change-Id: I4390020d24386df38b1fae32aeeb657456142abd
  • Loading branch information
jd committed Nov 15, 2013
1 parent 7ad530b commit ef6c659
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ceilometer/storage/impl_db2.py
Expand Up @@ -153,7 +153,8 @@ def connect(self, url):
client = self._pool.get(pool_key)()
if client:
return client
LOG.info('connecting to MongoDB on %s', url)
LOG.info(_('Connecting to DB2 on %s'),
connection_options['nodelist'])
client = pymongo.MongoClient(
url,
safe=True)
Expand Down
3 changes: 2 additions & 1 deletion ceilometer/storage/impl_mongodb.py
Expand Up @@ -155,7 +155,8 @@ def connect(self, url):
client = self._pool.get(pool_key)()
if client:
return client
LOG.info('connecting to MongoDB on %s', url)
LOG.info(_('Connecting to MongoDB on %s'),
connection_options['nodelist'])
client = pymongo.MongoClient(
url,
safe=True)
Expand Down

0 comments on commit ef6c659

Please sign in to comment.