Remove _get_default_role_counts, a unused function
Change-Id: I1941da397f08ce097ace2b9e7a7599baec97d53e
This commit is contained in:
parent
097210977f
commit
405e629254
@ -980,40 +980,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
|
|
||||||
utils_fixture.mock_deploy_tht.assert_called_with()
|
utils_fixture.mock_deploy_tht.assert_called_with()
|
||||||
|
|
||||||
def test_get_default_role_counts_defaults(self):
|
|
||||||
parsed_args = self.check_parser(self.cmd, [], [])
|
|
||||||
defaults = {
|
|
||||||
'ControllerCount': 1,
|
|
||||||
'ComputeCount': 1,
|
|
||||||
'ObjectStorageCount': 0,
|
|
||||||
'BlockStorageCount': 0,
|
|
||||||
'CephStorageCount': 0
|
|
||||||
}
|
|
||||||
self.assertEqual(
|
|
||||||
defaults,
|
|
||||||
self.cmd._get_default_role_counts(parsed_args))
|
|
||||||
|
|
||||||
@mock.patch("tripleoclient.utils.fetch_roles_file")
|
|
||||||
def test_get_default_role_counts_custom_roles(self, mock_roles):
|
|
||||||
roles_data = [
|
|
||||||
{'name': 'ControllerApi', 'CountDefault': 3},
|
|
||||||
{'name': 'ControllerPcmk', 'CountDefault': 3},
|
|
||||||
{'name': 'Compute', 'CountDefault': 3},
|
|
||||||
{'name': 'ObjectStorage', 'CountDefault': 0},
|
|
||||||
{'name': 'BlockStorage'}
|
|
||||||
]
|
|
||||||
mock_roles.return_value = roles_data
|
|
||||||
role_counts = {
|
|
||||||
'ControllerApiCount': 3,
|
|
||||||
'ControllerPcmkCount': 3,
|
|
||||||
'ComputeCount': 3,
|
|
||||||
'ObjectStorageCount': 0,
|
|
||||||
'BlockStorageCount': 0,
|
|
||||||
}
|
|
||||||
self.assertEqual(
|
|
||||||
role_counts,
|
|
||||||
self.cmd._get_default_role_counts(mock.Mock()))
|
|
||||||
|
|
||||||
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files')
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files')
|
||||||
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
||||||
'_create_parameters_env', autospec=True)
|
'_create_parameters_env', autospec=True)
|
||||||
|
@ -593,30 +593,6 @@ class DeployOvercloud(command.Command):
|
|||||||
"Error: The following environment directories were not found"
|
"Error: The following environment directories were not found"
|
||||||
": {0}".format(", ".join(nonexisting_dirs)))
|
": {0}".format(", ".join(nonexisting_dirs)))
|
||||||
|
|
||||||
def _get_default_role_counts(self, parsed_args):
|
|
||||||
|
|
||||||
if parsed_args.roles_file:
|
|
||||||
roles_data = utils.fetch_roles_file(parsed_args.roles_file,
|
|
||||||
parsed_args.templates)
|
|
||||||
else:
|
|
||||||
# Assume default role counts
|
|
||||||
return {
|
|
||||||
'ControllerCount': 1,
|
|
||||||
'ComputeCount': 1,
|
|
||||||
'ObjectStorageCount': 0,
|
|
||||||
'BlockStorageCount': 0,
|
|
||||||
'CephStorageCount': 0
|
|
||||||
}
|
|
||||||
|
|
||||||
default_role_counts = {}
|
|
||||||
for r in roles_data:
|
|
||||||
count_default = r.get('CountDefault', 0)
|
|
||||||
default_role_counts.setdefault(
|
|
||||||
"%sCount" % r['name'],
|
|
||||||
count_default)
|
|
||||||
|
|
||||||
return default_role_counts
|
|
||||||
|
|
||||||
def _provision_baremetal(self, parsed_args, tht_root):
|
def _provision_baremetal(self, parsed_args, tht_root):
|
||||||
|
|
||||||
if not parsed_args.baremetal_deployment:
|
if not parsed_args.baremetal_deployment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user