Remove security info from log output if not development mode
Use nailgun settings for determine mode, if development mode enabled -> allow log Closes-bug: #1546551 Change-Id: I280ca46547aaa382aa001387ae017025da227aa7
This commit is contained in:
parent
93f6e0db56
commit
6f72c9d3e9
|
@ -21,6 +21,7 @@ import os
|
|||
import sys
|
||||
import traceback
|
||||
import unittest2
|
||||
import yaml
|
||||
|
||||
import keystoneclient
|
||||
try:
|
||||
|
@ -423,6 +424,8 @@ FuelConf = [
|
|||
default=False,
|
||||
help='ssl usage'),
|
||||
cfg.BoolOpt('ssl_data',
|
||||
default=False),
|
||||
cfg.BoolOpt('development_mode',
|
||||
default=False)
|
||||
]
|
||||
|
||||
|
@ -589,6 +592,13 @@ class NailgunConfig(object):
|
|||
if parse:
|
||||
self.prepare_config()
|
||||
|
||||
@property
|
||||
def development_mode(self):
|
||||
with open('/etc/nailgun/settings.yaml') as nailgun_opts:
|
||||
nailgun_settings = yaml.safe_load(nailgun_opts)
|
||||
self.fuel.development_mode = nailgun_settings['DEVELOPMENT']
|
||||
return nailgun_settings['DEVELOPMENT']
|
||||
|
||||
def prepare_config(self, *args, **kwargs):
|
||||
try:
|
||||
self._parse_meta()
|
||||
|
@ -618,7 +628,10 @@ class NailgunConfig(object):
|
|||
response = self.req_session.get(self.nailgun_url + api_url)
|
||||
LOG.info('RESPONSE %s STATUS %s' % (api_url, response.status_code))
|
||||
data = response.json()
|
||||
LOG.info('RESPONSE FROM %s - %s' % (api_url, data))
|
||||
|
||||
if self.development_mode:
|
||||
LOG.info('RESPONSE FROM %s - %s' % (api_url, data))
|
||||
|
||||
access_data = data['editable']['access']
|
||||
common_data = data['editable']['common']
|
||||
|
||||
|
|
Loading…
Reference in New Issue