Set resource._properties_data=None when loading from db
In I462ce7161497306483286b78416f9037ac80d6fa we changed to use the
frozen_defintion properties for delete. However, When deleting a
resource from backup stack, where the resource is in INIT_COMPLETE,
setting the _stored_properties_data(_properties_data) to {} when
loading the resource from the db, results in error, when resources
access properties in handle_delete.
Change-Id: If76372c7ef9aee258efb1bfbc724d8637bc6a32c
Closes-Bug: #1709682
(cherry picked from commit f849b4deb2
)
This commit is contained in:
parent
2b94474d31
commit
d4867d4a58
|
@ -136,7 +136,7 @@ class Resource(
|
|||
else:
|
||||
resource._properties_data = db_resource['properties_data']
|
||||
else:
|
||||
resource._properties_data = {}
|
||||
resource._properties_data = None
|
||||
|
||||
if db_resource['attr_data'] is not None:
|
||||
resource._attr_data = rpd.ResourcePropertiesData._from_db_object(
|
||||
|
|
|
@ -1021,7 +1021,7 @@ class StackTest(common.HeatTestCase):
|
|||
loaded_stack._update_all_resource_data(False, True)
|
||||
self.assertEqual('AResource',
|
||||
loaded_stack.outputs['TestOutput'].get_value())
|
||||
self.assertEqual({}, loaded_stack['AResource']._stored_properties_data)
|
||||
self.assertIsNone(loaded_stack['AResource']._stored_properties_data)
|
||||
|
||||
def test_adopt_stack_fails(self):
|
||||
adopt_data = '''{
|
||||
|
|
Loading…
Reference in New Issue