Skip to content

Commit c5b4383

Browse files
javierpenastrider
authored andcommitted
Fix the way auth_type default value is overriden
Commit 50f05448982b5fafd9d9a7783b639dd145090a0d to os-client-config removed the default values in the _defaults dict. This makes any call to cloud_config.set_default() before initializing the dict fail. The fix changes the way the auth_type default is overriden, by doing it when cloud_config.OpenStackConfig() is executed. Change-Id: If37d3ba303f01d4c77fd7c15a3cde9634534b64a Closes-bug: #1473921
1 parent 11c9695 commit c5b4383

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

openstackclient/shell.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def initialize_app(self, argv):
240240
# Set the default plugin to token_endpoint if url and token are given
241241
if (self.options.url and self.options.token):
242242
# Use service token authentication
243-
cloud_config.set_default('auth_type', 'token_endpoint')
243+
auth_type = 'token_endpoint'
244244
else:
245-
cloud_config.set_default('auth_type', 'osc_password')
245+
auth_type = 'osc_password'
246246
self.log.debug("options: %s", self.options)
247247

248248
project_id = getattr(self.options, 'project_id', None)
@@ -266,7 +266,8 @@ def initialize_app(self, argv):
266266
# Ignore the default value of interface. Only if it is set later
267267
# will it be used.
268268
cc = cloud_config.OpenStackConfig(
269-
override_defaults={'interface': None, })
269+
override_defaults={'interface': None,
270+
'auth_type': auth_type, })
270271
self.log.debug("defaults: %s", cc.defaults)
271272

272273
self.cloud = cc.get_one_cloud(

0 commit comments

Comments
 (0)