Skip to content

Commit 1c3cb0a

Browse files
author
Dean Troyer
committed
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
1 parent dd81ca0 commit 1c3cb0a

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

openstackclient/shell.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,24 +175,17 @@ def initialize_app(self, argv):
175175
def prepare_to_run_command(self, cmd):
176176
"""Set up auth and API versions"""
177177

178-
# TODO(dtroyer): Move this to osc-lib
179-
# NOTE(dtroyer): If auth is not required for a command, force fake
180-
# token auth so KSA plugins are happy
181-
182-
kwargs = {}
183-
if not cmd.auth_required:
184-
# Build fake token creds to keep ksa and o-c-c hushed
185-
kwargs['auth_type'] = 'token_endpoint'
186-
kwargs['auth'] = {}
187-
kwargs['auth']['token'] = 'x'
188-
kwargs['auth']['url'] = 'x'
178+
# TODO(dtroyer): Move this to osc-lib, remove entire method when 1.4.0
179+
# release is minimum version is in global-requirements
180+
# NOTE(dtroyer): If auth is not required for a command, skip
181+
# get_one_Cloud()'s validation to avoid loading plugins
182+
validate = cmd.auth_required
189183

190184
# Validate auth options
191185
self.cloud = self.cloud_config.get_one_cloud(
192186
cloud=self.options.cloud,
193187
argparse=self.options,
194-
validate=True,
195-
**kwargs
188+
validate=validate,
196189
)
197190
# Push the updated args into ClientManager
198191
self.client_manager._cli_options = self.cloud

0 commit comments

Comments
 (0)