From af0feeb18a4f5fb2c20fffb6d85617d1775e5844 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 25 Sep 2017 14:32:13 -0400 Subject: [PATCH] Ignore errors in OS::stack_id output If a provider stack contained an OS::stack_id output and there was an error in the output, we would raise TemplateOutputError when trying to calculate the reference ID of the facade resource. Since we do that in many API calls, such an error could render the stack effectively unusable. If we encounter such an error, log it and fall back to the default reference ID. Change-Id: I1bc921fe74c54eb0999541ef36afc42b9c19e9bc Partial-Bug: #1712280 Related-Bug: #1719333 --- heat/engine/resources/template_resource.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index 7ab803f823..60e665b822 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from oslo_serialization import jsonutils from requests import exceptions import six @@ -27,6 +28,8 @@ from heat.engine.resources import stack_resource from heat.engine import template from heat.rpc import api as rpc_api +LOG = logging.getLogger(__name__) + REMOTE_SCHEMES = ('http', 'https') LOCAL_SCHEMES = ('file',) @@ -316,6 +319,8 @@ class TemplateResource(stack_resource.StackResource): resource=self.name, attribute=STACK_ID_OUTPUT, message=output[rpc_api.OUTPUT_ERROR]) + except exception.TemplateOutputError as err: + LOG.info('%s', err) except (exception.InvalidTemplateAttribute, exception.NotFound): pass else: