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
This commit is contained in:
Dean Troyer 2016-08-24 15:26:39 -05:00
parent 3f86cc0d80
commit 188709c668
1 changed files with 6 additions and 2 deletions

View File

@ -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