aa58fbcacf
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 |
||
---|---|---|
.. | ||
__init__.py | ||
functional_base.py | ||
test_admin_actions.py | ||
test_autoscaling.py | ||
test_aws_stack.py | ||
test_cancel_update.py | ||
test_conditional_exposure.py | ||
test_conditions.py | ||
test_create_update.py | ||
test_default_parameters.py | ||
test_delete.py | ||
test_env_merge.py | ||
test_heat_autoscaling.py | ||
test_immutable_parameters.py | ||
test_instance_group.py | ||
test_nested_get_attr.py | ||
test_notifications.py | ||
test_preview_update.py | ||
test_purge.py | ||
test_replace_deprecated.py | ||
test_resource_chain.py | ||
test_resource_group.py | ||
test_simultaneous_update.py | ||
test_snapshot_restore.py | ||
test_software_deployment_group.py | ||
test_stack_cancel.py | ||
test_swiftsignal_update.py | ||
test_template_resource.py | ||
test_template_versions.py | ||
test_translation.py | ||
test_update_restricted.py | ||
test_validation.py | ||
test_versionnegotiation.py |