summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2016-08-24 15:26:39 -0500
committerDean Troyer <dtroyer@gmail.com>2016-08-24 16:57:56 -0500
commit188709c6688b6baa0b9e3c09f4dda745ab1e700e (patch)
treef4beeb4eff069df6757b9f9eae21a4fdf9412ae2 /openstackclient/shell.py
parent3f86cc0d80228d80c7e3b866c60abedaa58fbbd4 (diff)
downloadpython-openstackclient-188709c6688b6baa0b9e3c09f4dda745ab1e700e.tar.gz
Restore default auth-type for token/endpoint
The split to osc-lib shell lost the detection of --os-token and --os-url to set --os-auth-type token_endpoint Closes-bug: 1615988 Change-Id: I248f776a3a7b276195c162818f41ba20760ee545
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 67c51998..da58b63b 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -61,8 +61,12 @@ class OpenStackShell(shell.OpenStackShell):
def _final_defaults(self):
super(OpenStackShell, self)._final_defaults()
- # Set default auth type to password
- self._auth_type = 'password'
+ # 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
+ self._auth_type = 'token_endpoint'
+ else:
+ self._auth_type = 'password'
def _load_plugins(self):
"""Load plugins via stevedore