Skip to content

Commit a08b625

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Restore default auth-type for token/endpoint"
2 parents 2774145 + 188709c commit a08b625

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)