diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2017-04-24 18:57:05 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2017-04-24 18:57:10 -0500 |
| commit | ef99f444628282d06feae04514bd2a6328d87b93 (patch) | |
| tree | 679a61d840cef175b03ba2f12c4ef5b47f932b29 /openstackclient/shell.py | |
| parent | db6081fb802559cdb6623bbc5dbff597cd287b07 (diff) | |
| download | python-openstackclient-ef99f444628282d06feae04514bd2a6328d87b93.tar.gz | |
Improve no-auth path
The commands that do not require authentication sometimes still need
to call ClientManager.is_network_endpoint_enabled() to see if Neutron
is available. Optimize the paths a bit to skip auth when it is not
necessary; the upshot is Neutron will be assumed in these cases now.
This gets a LOT cleaner when it appears is a future osc-lib.
Change-Id: Ifaddc57dfa192bde04d0482e2cdcce111313a22a
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 8fdf0b61..2e384f8f 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -182,6 +182,12 @@ class OpenStackShell(shell.OpenStackShell): # get_one_Cloud()'s validation to avoid loading plugins validate = cmd.auth_required + # Force skipping auth for commands that do not need it + # NOTE(dtroyer): This is here because ClientManager does not have + # visibility into the Command object to get + # auth_required. It needs to move into osc-lib + self.client_manager._auth_required = cmd.auth_required + # Validate auth options self.cloud = self.cloud_config.get_one_cloud( cloud=self.options.cloud, |
