From 28e722edee259caac0ac6b14b1f717bd7aa8ee43 Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Wed, 11 Jan 2017 18:09:20 +0800 Subject: [PATCH] Add docs of update/replace *_FAILED resource for developer After we implemented the blueprint https://blueprints.launchpad.net/heat/+spec/custom-update-replace-for-failed-resources it is good to add docs for developer about this. Change-Id: I36ebe184497ecac0b8477d6778a0121dcb8ea406 --- doc/source/developing_guides/pluginguide.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/source/developing_guides/pluginguide.rst b/doc/source/developing_guides/pluginguide.rst index 4e64b1ff6c..88cb7d6b69 100644 --- a/doc/source/developing_guides/pluginguide.rst +++ b/doc/source/developing_guides/pluginguide.rst @@ -479,6 +479,16 @@ that updates require the engine to delete and re-create the resource have values of ``None`` :type prop_diff: collections.Mapping + *Note* Before calling ``handle_update`` we check whether need to replace + the resource, especially for resource in ``*_FAILED`` state, there is a + default implementation of ``needs_replace_failed`` in + ``heat.engine.resource.Resource`` that simply returns ``True`` indicating + that updates require replacement. And we override the implementation for + ``OS::Nova::Server``, ``OS::Cinder::Volume`` and all of neutron resources. + The base principle is that to check whether the resource exists underlying + and whether the real status is available. So override the method + ``needs_replace_failed`` for your resource plug-ins if needed. + .. py:function:: check_update_complete(self, token) If defined, will be called with the return value of ``handle_update``