Add secret tag to sensitive options

Add debug logging of options values on startup
This commit is contained in:
Scott Hussey 2017-06-19 16:34:35 -05:00
parent 87238db44d
commit 724e5791f2
3 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class DrydockConfig(object):
# API Authentication options
auth_options = [
cfg.StrOpt('admin_token', default='bigboss', help='X-Auth-Token value to bypass backend authentication'),
cfg.StrOpt('admin_token', default='bigboss', help='X-Auth-Token value to bypass backend authentication', secret=True),
cfg.BoolOpt('bypass_enabled', default=False, help='Can backend authentication be bypassed?'),
]

View File

@ -35,7 +35,7 @@ import drydock_provisioner.drivers.node.maasdriver.models.machine as maas_machin
class MaasNodeDriver(NodeDriver):
maasdriver_options = [
cfg.StrOpt('maas_api_key', help='The API key for accessing MaaS'),
cfg.StrOpt('maas_api_key', help='The API key for accessing MaaS', secret=True),
cfg.StrOpt('maas_api_url', help='The URL for accessing MaaS API'),
]

View File

@ -54,6 +54,7 @@ def start_drydock():
ch.setFormatter(formatter)
logger.addHandler(ch)
state = statemgmt.DesignState()
orchestrator = orch.Orchestrator(drydock_provisioner.conf.plugins,
@ -61,6 +62,9 @@ def start_drydock():
input_ingester = ingester.Ingester()
input_ingester.enable_plugins(drydock_provisioner.conf.plugins.ingester)
# Now that loggers are configured, log the effective config
drydock_provisioner.conf.log_opt_values(logging.getLogger(drydock_provisioner.conf.logging.global_logger_name), logging.DEBUG)
return api.start_api(state_manager=state, ingester=input_ingester,
orchestrator=orchestrator)