diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2019-08-22 23:55:01 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2019-09-09 14:01:57 +0000 |
| commit | ee48777207e0682862cf43fdf2f2f5dffc37d22a (patch) | |
| tree | 91555546171a2b3a71ca6659130451fba2222119 /openstackclient/shell.py | |
| parent | dd1ce370424264166be686578bcab0fa41ac973e (diff) | |
| download | python-openstackclient-ee48777207e0682862cf43fdf2f2f5dffc37d22a.tar.gz | |
Clean up app initialization and config
* Remove unnecessary code in OpenStackShell.initialize_app() - only
the bits it instantiate our subclass of ClientManager remain
* Remove OSC_Config - with https://review.opendev.org/#/c/678095/
the last remaining required bit moves to osc-lib
Thos requires osc-lib 1.14.0
Change-Id: Ia4b3c737de9dc34949e74632441621014ef9eea9
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 4489219f..7fbda1ae 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -25,7 +25,6 @@ from osc_lib import shell import six import openstackclient -from openstackclient.common import client_config as cloud_config from openstackclient.common import clientmanager @@ -133,37 +132,7 @@ class OpenStackShell(shell.OpenStackShell): def initialize_app(self, argv): super(OpenStackShell, self).initialize_app(argv) - # Argument precedence is really broken in multiple places - # so we're just going to fix it here until o-c-c and osc-lib - # get sorted out. - # TODO(dtroyer): remove when os-client-config and osc-lib are fixed - - # First, throw away what has already been done with o-c-c and - # use our own. - try: - self.cloud_config = cloud_config.OSC_Config( - override_defaults={ - 'interface': None, - 'auth_type': self._auth_type, - }, - ) - except (IOError, OSError): - self.log.critical("Could not read clouds.yaml configuration file") - self.print_help_if_requested() - raise - - if not self.options.debug: - self.options.debug = None - - # NOTE(dtroyer): Need to do this with validate=False to defer the - # auth plugin handling to ClientManager.setup_auth() - self.cloud = self.cloud_config.get_one_cloud( - cloud=self.options.cloud, - argparse=self.options, - validate=False, - ) - - # Then, re-create the client_manager with the correct arguments + # Re-create the client_manager with our subclass self.client_manager = clientmanager.ClientManager( cli_options=self.cloud, api_version=self.api_version, |
