openstack-heat/heat
Zane Bitter aa58fbcacf Load existing resources using correct environment
In convergence we were loading resources from the database using the
current environment. This is incorrect when a previous update has
failed, meaning the resources in the database were created with a
non-current template and environment. If an attempt was made to change
the type of a resource but that resource was never updated, this will
result in us loading a resource with the wrong type. If the type has
been removed then it can result in errors just trying to show the stack.

Note that the Resource.load() method used during a convergence traversal
already does the Right Thing - it only uses the new type if it is a
valid substitution for the old type, and UpdateReplace is later raised
in Resource.update_convergence() if the type does not match in that
specified in the new environment. So we don't see any problems with
stack updates, just with API calls.

Since we cannot change the signature of Resource.__new__() without also
modifying the signature of __init__() in every resource plugin that has
implemented it (many of which are out of tree), instead substitute the
stack definition for the duration of creating the Resource object. This
will result in stack.env returning the environment the resource was last
updated with.

Change-Id: I3fbd14324fc4681b26747ee7505000b8fc9439f1
Story: #2005090
Task: 29688
2019-04-01 14:21:44 +05:30
..
api middleware: return HTTPBadRequest when path is invalid 2018-09-11 11:23:46 +02:00
cloudinit Validate that python3 is ready for loguserdata 2016-08-26 11:49:30 +00:00
cmd Add heat-status upgrade check command framework 2018-10-22 14:19:36 +00:00
common Merge "Deprecate personality for OS::Nova::Server" 2019-03-18 09:23:50 +00:00
db Merge "Allow global admins to operate sd resources from other projects" 2019-01-24 08:19:17 +00:00
engine Load existing resources using correct environment 2019-04-01 14:21:44 +05:30
hacking Restrict use of iteritems, iterkeys and itervalues 2016-03-23 10:05:54 +00:00
httpd Remove unnecessary shebangs from service scripts 2018-08-01 10:53:51 +05:30
locale Imported Translations from Zanata 2019-01-24 06:46:07 +00:00
objects Streamline conversion of resources to convergence 2018-12-17 16:59:25 +13:00
policies Add a Blazar Host resource 2019-02-18 06:41:23 +00:00
rpc Option for retrieving child templates and env files from swift 2018-07-26 09:50:51 +05:30
scaling Merge "Eliminate nested stack loading in InstanceGroup/ASG scaling" 2018-04-02 04:35:47 +00:00
tests Merge "Handle unicode in constraints" 2019-03-27 22:56:23 +00:00
__init__.py
version.py change the dist name to 'openstack-heat' 2018-11-01 11:54:05 -04:00