Remove unused object storage client implementation

This implementation is no longer used since Swift was removed from
Undercloud.

Change-Id: I41ac3b85e379cda7a8d414a2e17e4a57af15f387
This commit is contained in:
Takashi Kajinami 2022-05-10 15:28:43 +09:00
parent 16984a5b1c
commit 0e632c6b9d
4 changed files with 0 additions and 50 deletions

View File

@ -18,7 +18,6 @@
import logging
from osc_lib import utils
from swiftclient import client as swift_client
LOG = logging.getLogger(__name__)
@ -63,7 +62,6 @@ class ClientWrapper(object):
def __init__(self, instance):
self._instance = instance
self._object_store = None
self._local_orchestration = None
def local_orchestration(self, api_port):
@ -92,29 +90,3 @@ class ClientWrapper(object):
self._local_orchestration = client
return self._local_orchestration
@property
def object_store(self):
"""Returns an object_store service client
The Swift/Object client returned by python-openstack client isn't an
instance of python-swiftclient, and had far less functionality.
"""
if self._object_store is not None:
return self._object_store
endpoint = self._instance.get_endpoint_for_service_type(
"object-store",
region_name=self._instance._region_name,
)
token = self._instance.auth.get_token(self._instance.session)
kwargs = {
'preauthurl': endpoint,
'preauthtoken': token
}
self._object_store = swift_client.Connection(**kwargs)
return self._object_store

View File

@ -210,7 +210,6 @@ class FakeClientWrapper(object):
def __init__(self):
self._instance = mock.Mock()
self.object_store = FakeObjectClient()
class FakeRunnerConfig(object):
@ -256,19 +255,6 @@ class FakeInstanceData(object):
_data = {'token': {}}
class FakeObjectClient(object):
def __init__(self):
self._instance = mock.Mock()
self.put_object = mock.Mock()
def get_object(self, *args):
return [None, "fake"]
def get_container(self, *args):
return [None, [{"name": "fake"}]]
class FakePlaybookExecution(utils.TestCommand):
def setUp(self, ansible_mock=True):

View File

@ -30,7 +30,6 @@ class TestOvercloudExport(utils.TestCommand):
self.app.client_manager.orchestration = mock.Mock()
self.tripleoclient = mock.Mock()
self.app.client_manager.tripleoclient = self.tripleoclient
self.app.client_manager.tripleoclient.object_store = mock.Mock()
self.mock_open = mock.mock_open()
@mock.patch('os.path.exists')

View File

@ -1068,13 +1068,6 @@ class DeployOvercloud(command.Command):
self._setup_clients(parsed_args)
# Swiftclient logs things like 404s at error level, which is a problem
# because we use EAFP to check for the existence of files. Turn off
# most swiftclient logging to avoid cluttering up our output with
# pointless tracebacks.
sc_logger = logging.getLogger("swiftclient")
sc_logger.setLevel(logging.CRITICAL)
_update_args_from_answers_file(parsed_args)
_validate_args(parsed_args)