Merge "Turn the orchestration client reference into a property"
This commit is contained in:
commit
c772b51282
@ -90,6 +90,7 @@ class ClientWrapper(object):
|
|||||||
|
|
||||||
return self._baremetal
|
return self._baremetal
|
||||||
|
|
||||||
|
@property
|
||||||
def orchestration(self):
|
def orchestration(self):
|
||||||
"""Returns an orchestration service client"""
|
"""Returns an orchestration service client"""
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ class FakeClientWrapper(object):
|
|||||||
self._orchestration = mock.Mock()
|
self._orchestration = mock.Mock()
|
||||||
self._baremetal = mock.Mock()
|
self._baremetal = mock.Mock()
|
||||||
|
|
||||||
|
@property
|
||||||
def orchestration(self):
|
def orchestration(self):
|
||||||
return self._orchestration
|
return self._orchestration
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
||||||
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
orchestration_client.stacks.get.return_value = fakes.create_tht_stack()
|
orchestration_client.stacks.get.return_value = fakes.create_tht_stack()
|
||||||
|
|
||||||
mock_check_hypervisor_stats.return_value = {
|
mock_check_hypervisor_stats.return_value = {
|
||||||
@ -255,7 +255,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
||||||
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
mock_stack = fakes.create_tht_stack()
|
mock_stack = fakes.create_tht_stack()
|
||||||
orchestration_client.stacks.get.return_value = None
|
orchestration_client.stacks.get.return_value = None
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
mock_generate_overcloud_passwords.return_value = self._get_passwords()
|
||||||
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
orchestration_client.stacks.get.return_value = fakes.create_tht_stack()
|
orchestration_client.stacks.get.return_value = fakes.create_tht_stack()
|
||||||
|
|
||||||
mock_check_hypervisor_stats.return_value = {
|
mock_check_hypervisor_stats.return_value = {
|
||||||
@ -577,7 +577,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
autospec=True)
|
autospec=True)
|
||||||
def test_pre_heat_deploy_failed(self, mock_check_hypervisor_stats):
|
def test_pre_heat_deploy_failed(self, mock_check_hypervisor_stats):
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
orchestration_client.stacks.get.return_value = None
|
orchestration_client.stacks.get.return_value = None
|
||||||
mock_check_hypervisor_stats.return_value = None
|
mock_check_hypervisor_stats.return_value = None
|
||||||
arglist = ['--templates']
|
arglist = ['--templates']
|
||||||
|
@ -229,7 +229,7 @@ class DeployOvercloud(command.Command):
|
|||||||
files = dict(list(template_files.items()) + list(env_files.items()))
|
files = dict(list(template_files.items()) + list(env_files.items()))
|
||||||
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
|
|
||||||
self.log.debug("Deploying stack: %s", stack_name)
|
self.log.debug("Deploying stack: %s", stack_name)
|
||||||
self.log.debug("Deploying template: %s", template)
|
self.log.debug("Deploying template: %s", template)
|
||||||
@ -859,7 +859,7 @@ class DeployOvercloud(command.Command):
|
|||||||
"configuration, proceeding.")
|
"configuration, proceeding.")
|
||||||
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.tripleoclient.orchestration()
|
orchestration_client = clients.tripleoclient.orchestration
|
||||||
|
|
||||||
stack = utils.get_stack(orchestration_client, parsed_args.stack)
|
stack = utils.get_stack(orchestration_client, parsed_args.stack)
|
||||||
stack_create = stack is None
|
stack_create = stack is None
|
||||||
|
@ -53,7 +53,7 @@ class DeleteNode(command.Command):
|
|||||||
self.log.debug("take_action(%s)" % parsed_args)
|
self.log.debug("take_action(%s)" % parsed_args)
|
||||||
osc_plugin = self.app.client_manager.tripleoclient
|
osc_plugin = self.app.client_manager.tripleoclient
|
||||||
|
|
||||||
orchestration = osc_plugin.orchestration()
|
orchestration = osc_plugin.orchestration
|
||||||
scale_manager = scale.ScaleManager(
|
scale_manager = scale.ScaleManager(
|
||||||
heatclient=orchestration,
|
heatclient=orchestration,
|
||||||
stack_id=parsed_args.stack,
|
stack_id=parsed_args.stack,
|
||||||
|
@ -57,7 +57,7 @@ class UpdateOvercloud(command.Command):
|
|||||||
self.log.debug("take_action(%s)" % parsed_args)
|
self.log.debug("take_action(%s)" % parsed_args)
|
||||||
osc_plugin = self.app.client_manager.tripleoclient
|
osc_plugin = self.app.client_manager.tripleoclient
|
||||||
|
|
||||||
orchestration = osc_plugin.orchestration()
|
orchestration = osc_plugin.orchestration
|
||||||
update_manager = update.PackageUpdateManager(
|
update_manager = update.PackageUpdateManager(
|
||||||
heatclient=orchestration,
|
heatclient=orchestration,
|
||||||
novaclient=self.app.client_manager.compute,
|
novaclient=self.app.client_manager.compute,
|
||||||
|
Loading…
Reference in New Issue
Block a user