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.

Change-Id: Ie68c82f7b073012685f0513b615ab1bf00bc0c3a
This commit is contained in:
Dean Troyer 2017-03-27 15:50:08 -05:00
parent 8d3333cc3c
commit 7881c8abd6

View File

@ -430,20 +430,15 @@ class OpenStackShell(app.App):
cmd.__class__.__name__,
)
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'
# 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