Turn the orchestration client reference into a property

Use a property instead of a function. This is more in line with how the
clients are referenced with openstackclient, thereby making it easier
to switch to the a Heat OSC plugin in the future.

Change-Id: I849593e6328f3883235e9ae34232f92d6b3c0d80
This commit is contained in:
Brad P. Crochet 2015-09-17 10:23:56 -04:00 committed by Dougal Matthews
parent 853aace442
commit 90bf132049
6 changed files with 10 additions and 8 deletions

View File

@ -90,6 +90,7 @@ class ClientWrapper(object):
return self._baremetal
@property
def orchestration(self):
"""Returns an orchestration service client"""

View File

@ -50,6 +50,7 @@ class FakeClientWrapper(object):
self._orchestration = mock.Mock()
self._baremetal = mock.Mock()
@property
def orchestration(self):
return self._orchestration

View File

@ -104,7 +104,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_generate_overcloud_passwords.return_value = self._get_passwords()
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()
mock_check_hypervisor_stats.return_value = {
@ -253,7 +253,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_generate_overcloud_passwords.return_value = self._get_passwords()
clients = self.app.client_manager
orchestration_client = clients.tripleoclient.orchestration()
orchestration_client = clients.tripleoclient.orchestration
mock_stack = fakes.create_tht_stack()
orchestration_client.stacks.get.return_value = None
@ -410,7 +410,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_generate_overcloud_passwords.return_value = self._get_passwords()
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()
mock_check_hypervisor_stats.return_value = {
@ -562,7 +562,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
autospec=True)
def test_pre_heat_deploy_failed(self, mock_check_hypervisor_stats):
clients = self.app.client_manager
orchestration_client = clients.tripleoclient.orchestration()
orchestration_client = clients.tripleoclient.orchestration
orchestration_client.stacks.get.return_value = None
mock_check_hypervisor_stats.return_value = None
arglist = ['--templates']

View File

@ -285,7 +285,7 @@ class DeployOvercloud(command.Command):
files = dict(list(template_files.items()) + list(env_files.items()))
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 template: %s", template)
@ -970,7 +970,7 @@ class DeployOvercloud(command.Command):
"configuration, proceeding.")
clients = self.app.client_manager
orchestration_client = clients.tripleoclient.orchestration()
orchestration_client = clients.tripleoclient.orchestration
stack = self._get_stack(orchestration_client, parsed_args.stack)
stack_create = stack is None

View File

@ -53,7 +53,7 @@ class DeleteNode(command.Command):
self.log.debug("take_action(%s)" % parsed_args)
osc_plugin = self.app.client_manager.tripleoclient
orchestration = osc_plugin.orchestration()
orchestration = osc_plugin.orchestration
scale_manager = scale.ScaleManager(
heatclient=orchestration,
stack_id=parsed_args.stack,

View File

@ -57,7 +57,7 @@ class UpdateOvercloud(command.Command):
self.log.debug("take_action(%s)" % parsed_args)
osc_plugin = self.app.client_manager.tripleoclient
orchestration = osc_plugin.orchestration()
orchestration = osc_plugin.orchestration
update_manager = update.PackageUpdateManager(
heatclient=orchestration,
novaclient=self.app.client_manager.compute,