Fix unicodeerror when heat-engine start

If change local language to other languages(like ja), heat-engine
will failed to start.

Closes-Bug: #1446958
Change-Id: Ia3cbcebb86257bc1c52ea758c1583191e5a52a2d
This commit is contained in:
Ethan Lynn 2015-04-22 13:46:11 +08:00
parent 8b2723e23f
commit 0b3dd7be3d
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import warnings
from oslo_config import cfg
from oslo_log import log
from oslo_utils import encodeutils
import six
from heat.common import environment_format as env_fmt
@ -258,7 +259,8 @@ class ResourceRegistry(object):
if isinstance(info, ClassResourceInfo):
if info.value.support_status.status != support.SUPPORTED:
warnings.warn(six.text_type(info.value.support_status.message))
warnings.warn(encodeutils.safe_encode(
info.value.support_status.message))
info.user_resource = (self.global_registry is not None)
registry[name] = info