Merge "Fix of Overcloud Update"
This commit is contained in:
commit
b044b4a991
@ -277,9 +277,8 @@ class OvercloudsController(rest.RestController):
|
|||||||
# this probably should also have workflow
|
# this probably should also have workflow
|
||||||
# step 1- build template and stack-update
|
# step 1- build template and stack-update
|
||||||
# step 2- set the correct overcloud status
|
# step 2- set the correct overcloud status
|
||||||
|
process_stack(updated_overcloud.attributes, result.counts,
|
||||||
process_stack(updated_overcloud.attributes, updated_overcloud.counts,
|
get_overcloud_roles_dict())
|
||||||
get_overcloud_roles_dict(), create=True)
|
|
||||||
|
|
||||||
return updated_overcloud
|
return updated_overcloud
|
||||||
|
|
||||||
|
@ -319,9 +319,25 @@ class OvercloudTests(base.TestCase):
|
|||||||
# Setup
|
# Setup
|
||||||
changes = {'name': 'updated'}
|
changes = {'name': 'updated'}
|
||||||
|
|
||||||
|
overcloud_role_1 = db_models.OvercloudRole(
|
||||||
|
image_name='overcloud-compute', flavor_id='1')
|
||||||
|
|
||||||
|
overcloud_role_2 = db_models.OvercloudRole(
|
||||||
|
image_name='overcloud-cinder-volume', flavor_id='1')
|
||||||
|
|
||||||
|
overcloud_role_count_1 = db_models.OvercloudRoleCount(
|
||||||
|
overcloud_role_id=1, num_nodes=5, overcloud_role=overcloud_role_1)
|
||||||
|
|
||||||
|
overcloud_role_count_2 = db_models.OvercloudRoleCount(
|
||||||
|
overcloud_role_id=2, num_nodes=9, overcloud_role=overcloud_role_2)
|
||||||
|
|
||||||
|
attribute_1 = db_models.OvercloudAttribute(
|
||||||
|
overcloud_id=1, key='name', value='updated')
|
||||||
|
|
||||||
fake_updated = db_models.Overcloud(name='after-update',
|
fake_updated = db_models.Overcloud(name='after-update',
|
||||||
attributes=[],
|
attributes=[attribute_1],
|
||||||
counts=[])
|
counts=[overcloud_role_count_1,
|
||||||
|
overcloud_role_count_2])
|
||||||
mock_db_update.return_value = fake_updated
|
mock_db_update.return_value = fake_updated
|
||||||
mock_process_stack.return_value = None
|
mock_process_stack.return_value = None
|
||||||
|
|
||||||
@ -341,6 +357,10 @@ class OvercloudTests(base.TestCase):
|
|||||||
self.assertEqual(db_update_model.id, 12345)
|
self.assertEqual(db_update_model.id, 12345)
|
||||||
self.assertEqual(db_update_model.name, changes['name'])
|
self.assertEqual(db_update_model.name, changes['name'])
|
||||||
|
|
||||||
|
mock_process_stack.assert_called_once_with(
|
||||||
|
{'name': 'updated'}, [overcloud_role_count_1,
|
||||||
|
overcloud_role_count_2], {})
|
||||||
|
|
||||||
@mock.patch('tuskar.db.sqlalchemy.api.'
|
@mock.patch('tuskar.db.sqlalchemy.api.'
|
||||||
'Connection.delete_overcloud_by_id')
|
'Connection.delete_overcloud_by_id')
|
||||||
@mock.patch(
|
@mock.patch(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user