From 04d8552721f1c68f0364ce16a1b1e341f560daf2 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Fri, 3 Feb 2017 11:46:42 +0100 Subject: [PATCH] Log an actual error message when failed to load new style credentials It's hard to switch one's configuration to new options without knowing what exactly goes wrong. Change-Id: I302c596c9e27265b77b6ea41aaee4b4f9e884cfd Related-Bug: #1661250 --- ironic/conf/auth.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ironic/conf/auth.py b/ironic/conf/auth.py index 26dcdac1e2..8b3f1503dd 100644 --- a/ironic/conf/auth.py +++ b/ironic/conf/auth.py @@ -17,8 +17,10 @@ import copy from keystoneauth1 import exceptions as kaexception from keystoneauth1 import loading as kaloading from oslo_config import cfg +from oslo_log import log +LOG = log.getLogger(__name__) LEGACY_SECTION = 'keystone_authtoken' OLD_SESSION_OPTS = { 'certfile': [cfg.DeprecatedOpt('certfile', LEGACY_SECTION)], @@ -35,7 +37,9 @@ cfg.CONF.import_group(LEGACY_SECTION, 'keystonemiddleware.auth_token') def load_auth(conf, group): try: auth = kaloading.load_auth_from_conf_options(conf, group) - except kaexception.MissingRequiredOptions: + except kaexception.MissingRequiredOptions as exc: + LOG.debug('Failed to load credentials from group %(grp)s: %(err)s', + {'grp': group, 'err': exc}) auth = None return auth