Skip to content

Commit 279066b

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Change noauth strategy for plugin loading"
2 parents d0f368b + 1c3cb0a commit 279066b

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)