Handle non-string types in comment

This is not supported, but we should convert blindly to string rather
that stacktracing the highstate outputter.
This commit is contained in:
Colton Myers 2016-01-29 16:14:30 -07:00
parent 11e34d047b
commit 1b5c6a240c

View file

@ -241,7 +241,7 @@ def _format_host(host, data):
# be sure that ret['comment'] is utf-8 friendly
try:
if not isinstance(ret['comment'], six.text_type):
ret['comment'] = ret['comment'].decode('utf-8')
ret['comment'] = str(ret['comment']).decode('utf-8')
except UnicodeDecodeError:
# but try to continue on errors
pass