Merge "Fix of Overcloud Update"

This commit is contained in:
Jenkins 2014-03-13 11:09:25 +00:00 committed by Gerrit Code Review
commit b044b4a991
2 changed files with 24 additions and 5 deletions

View File

@ -277,9 +277,8 @@ class OvercloudsController(rest.RestController):
# this probably should also have workflow
# step 1- build template and stack-update
# step 2- set the correct overcloud status
process_stack(updated_overcloud.attributes, updated_overcloud.counts,
get_overcloud_roles_dict(), create=True)
process_stack(updated_overcloud.attributes, result.counts,
get_overcloud_roles_dict())
return updated_overcloud

View File

@ -319,9 +319,25 @@ class OvercloudTests(base.TestCase):
# Setup
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',
attributes=[],
counts=[])
attributes=[attribute_1],
counts=[overcloud_role_count_1,
overcloud_role_count_2])
mock_db_update.return_value = fake_updated
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.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.'
'Connection.delete_overcloud_by_id')
@mock.patch(