Skip to content

Commit 188709c

Browse files
author
Dean Troyer
committed
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
1 parent 3f86cc0 commit 188709c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

openstackclient/shell.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ def build_option_parser(self, description, version):
6161
def _final_defaults(self):
6262
super(OpenStackShell, self)._final_defaults()
6363

64-
# Set default auth type to password
65-
self._auth_type = 'password'
64+
# Set the default plugin to token_endpoint if url and token are given
65+
if (self.options.url and self.options.token):
66+
# Use service token authentication
67+
self._auth_type = 'token_endpoint'
68+
else:
69+
self._auth_type = 'password'
6670

6771
def _load_plugins(self):
6872
"""Load plugins via stevedore

0 commit comments

Comments
 (0)