Skip to content

Commit ee48777

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

2 files changed

Lines changed: 1 addition & 103 deletions

File tree

openstackclient/common/client_config.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

openstackclient/shell.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import six
2626

2727
import openstackclient
28-
from openstackclient.common import client_config as cloud_config
2928
from openstackclient.common import clientmanager
3029

3130

@@ -133,37 +132,7 @@ def _load_commands(self):
133132
def initialize_app(self, argv):
134133
super(OpenStackShell, self).initialize_app(argv)
135134

136-
# Argument precedence is really broken in multiple places
137-
# so we're just going to fix it here until o-c-c and osc-lib
138-
# get sorted out.
139-
# TODO(dtroyer): remove when os-client-config and osc-lib are fixed
140-
141-
# First, throw away what has already been done with o-c-c and
142-
# use our own.
143-
try:
144-
self.cloud_config = cloud_config.OSC_Config(
145-
override_defaults={
146-
'interface': None,
147-
'auth_type': self._auth_type,
148-
},
149-
)
150-
except (IOError, OSError):
151-
self.log.critical("Could not read clouds.yaml configuration file")
152-
self.print_help_if_requested()
153-
raise
154-
155-
if not self.options.debug:
156-
self.options.debug = None
157-
158-
# NOTE(dtroyer): Need to do this with validate=False to defer the
159-
# auth plugin handling to ClientManager.setup_auth()
160-
self.cloud = self.cloud_config.get_one_cloud(
161-
cloud=self.options.cloud,
162-
argparse=self.options,
163-
validate=False,
164-
)
165-
166-
# Then, re-create the client_manager with the correct arguments
135+
# Re-create the client_manager with our subclass
167136
self.client_manager = clientmanager.ClientManager(
168137
cli_options=self.cloud,
169138
api_version=self.api_version,

0 commit comments

Comments
 (0)