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
This commit is contained in:
Miguel Grinberg
2015-05-27 18:57:56 -07:00
parent 6cf94a3ece
commit 960c43c7cd

View File

@@ -259,6 +259,7 @@ class ResourceRegistry(object):
if isinstance(info, ClassResourceInfo):
if info.value.support_status.status != support.SUPPORTED:
if info.value.support_status.message is not None:
warnings.warn(encodeutils.safe_encode(
info.value.support_status.message))