summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-03 21:50:39 +0000
committerGerrit Code Review <review@openstack.org>2017-04-03 21:50:39 +0000
commit279066b67c536a2970446779b41410315647ecaf (patch)
tree0d81f8a624cc3a8b9073a905a20435381881a0ea /openstackclient
parentd0f368ba0e0793b8dfc800ea0ef7c60b3e94d5df (diff)
parent1c3cb0a3b54cdb6cd5b27e88372b65cfac844422 (diff)
downloadpython-openstackclient-279066b67c536a2970446779b41410315647ecaf.tar.gz
Merge "Change noauth strategy for plugin loading"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/shell.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index d7fe6ac1..4ec357cd 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -175,24 +175,17 @@ class OpenStackShell(shell.OpenStackShell):
def prepare_to_run_command(self, cmd):
"""Set up auth and API versions"""
- # TODO(dtroyer): Move this to osc-lib
- # NOTE(dtroyer): If auth is not required for a command, force fake
- # token auth so KSA plugins are happy
-
- kwargs = {}
- if not cmd.auth_required:
- # Build fake token creds to keep ksa and o-c-c hushed
- kwargs['auth_type'] = 'token_endpoint'
- kwargs['auth'] = {}
- kwargs['auth']['token'] = 'x'
- kwargs['auth']['url'] = 'x'
+ # TODO(dtroyer): Move this to osc-lib, remove entire method when 1.4.0
+ # release is minimum version is in global-requirements
+ # NOTE(dtroyer): If auth is not required for a command, skip
+ # get_one_Cloud()'s validation to avoid loading plugins
+ validate = cmd.auth_required
# Validate auth options
self.cloud = self.cloud_config.get_one_cloud(
cloud=self.options.cloud,
argparse=self.options,
- validate=True,
- **kwargs
+ validate=validate,
)
# Push the updated args into ClientManager
self.client_manager._cli_options = self.cloud