summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJavier Pena <jpena@redhat.com>2015-07-06 18:04:18 +0200
committerGael Chamoulaud <gchamoul@redhat.com>2015-07-20 15:29:41 +0200
commitc5b43831606e0fd813e1f06b40950f8c85555953 (patch)
treeb9fceb6468885237c822a2dce03d2dc6aade3cd6 /openstackclient
parent11c9695e5ef127d0c99e2af610e462f5b1af4933 (diff)
downloadpython-openstackclient-c5b43831606e0fd813e1f06b40950f8c85555953.tar.gz
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
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/shell.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index edeffdfb..319f10de 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -240,9 +240,9 @@ class OpenStackShell(app.App):
# Set the default plugin to token_endpoint if url and token are given
if (self.options.url and self.options.token):
# Use service token authentication
- cloud_config.set_default('auth_type', 'token_endpoint')
+ auth_type = 'token_endpoint'
else:
- cloud_config.set_default('auth_type', 'osc_password')
+ auth_type = 'osc_password'
self.log.debug("options: %s", self.options)
project_id = getattr(self.options, 'project_id', None)
@@ -266,7 +266,8 @@ class OpenStackShell(app.App):
# Ignore the default value of interface. Only if it is set later
# will it be used.
cc = cloud_config.OpenStackConfig(
- override_defaults={'interface': None, })
+ override_defaults={'interface': None,
+ 'auth_type': auth_type, })
self.log.debug("defaults: %s", cc.defaults)
self.cloud = cc.get_one_cloud(