From 960c43c7cd8409b566ec838f9ebd629033135a5d Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Wed, 27 May 2015 18:57:56 -0700 Subject: [PATCH] Avoid crash when registering resources When a resource that has a support status different than SUPPORTED is registered, the heat engine prints the message associated with its SupportStatus object as a warning. This change avoids an engine crash that occurs when a resource's SupportStatus does not define a message. Change-Id: Id86bf93baade5b4fb0a71a80275b20d70710f2f4 --- heat/engine/environment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/heat/engine/environment.py b/heat/engine/environment.py index b38d369407..222fec06d2 100644 --- a/heat/engine/environment.py +++ b/heat/engine/environment.py @@ -259,8 +259,9 @@ class ResourceRegistry(object): if isinstance(info, ClassResourceInfo): if info.value.support_status.status != support.SUPPORTED: - warnings.warn(encodeutils.safe_encode( - info.value.support_status.message)) + if info.value.support_status.message is not None: + warnings.warn(encodeutils.safe_encode( + info.value.support_status.message)) info.user_resource = (self.global_registry is not None) registry[name] = info