Add cloud to warning about domain related config

When this warning fires you get a bunch of

 Ignoring domain related config project_domain_name because identity API version is 2.0
 Ignoring domain related config user_domain_name because identity API version is 2.0

in the output, but no clue as to what cloud was actually causing the
problem to help you debug.  This is a bit annoying if you have many
different clouds setup in your configuration.  Add the name of the
cloud to the message.

Change-Id: Id2b5133f583f7071745e02001eaeaa3dcee211ba
This commit is contained in:
Ian Wienand 2018-06-22 09:46:11 +10:00
parent f5166dcff7
commit 6ed7f60299
2 changed files with 4 additions and 2 deletions

View File

@ -101,8 +101,9 @@ class OSC_Config(config.OpenStackConfig):
]
for prop in domain_props:
if config['auth'].pop(prop, None) is not None:
LOG.warning("Ignoring domain related config " +
prop + " because identity API version is 2.0")
LOG.warning("Ignoring domain related config %s for %s"
"because identity API version is 2.0" %
(prop, config['cloud']))
return config
def _auth_default_domain(self, config):

View File

@ -151,6 +151,7 @@ class TestOSCConfig(utils.TestCase):
def test_auth_v2_ignore_v3(self):
config = {
'cloud': 'testcloud',
'identity_api_version': '2',
'auth_type': 'v2password',
'auth': {