diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2017-03-27 15:52:04 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2017-03-27 19:58:40 -0500 |
| commit | 1c3cb0a3b54cdb6cd5b27e88372b65cfac844422 (patch) | |
| tree | d9d7c2561b8788cb6d834246a3929d106dacee84 /openstackclient | |
| parent | dd81ca0692ebe6c4892271da60a1e5eceba8d25c (diff) | |
| download | python-openstackclient-1c3cb0a3b54cdb6cd5b27e88372b65cfac844422.tar.gz | |
Change noauth strategy for plugin loading
Don't do it.
os-client-config's plugin loading has been causing this pain for a long
time, removing the KSC hack-around in o-c-c unmasked this again. So when
auth is not reuired, just don't let o-c-c do any plugin loading at all.
Ever.
Of course, this shouldn't be in OSC either, but we have to do this until
the equivalent fix lands in osc-lib, is released and makes it into the
global requirements minimum version.
Depends-on: Ie68c82f7b073012685f0513b615ab1bf00bc0c3a
Change-Id: Ifdf65f3bb90fb923947a2cbe80a881d71a3fee56
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/shell.py | 19 |
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 |
