diff --git a/heat/engine/cfn/functions.py b/heat/engine/cfn/functions.py index c976439efa..2d600f6cf8 100644 --- a/heat/engine/cfn/functions.py +++ b/heat/engine/cfn/functions.py @@ -302,7 +302,8 @@ class Join(function.Function): if s is None: return '' if not isinstance(s, basestring): - raise TypeError(_('Items to join must be strings')) + raise TypeError( + _('Items to join must be strings %s') % (repr(s)[:200])) return s return delim.join(ensure_string(s) for s in strings) diff --git a/heat/tests/test_parser.py b/heat/tests/test_parser.py index d841bd6bfd..5af1635818 100644 --- a/heat/tests/test_parser.py +++ b/heat/tests/test_parser.py @@ -852,6 +852,14 @@ class ResolveDataTest(HeatTestCase): [' ', ['foo', 'bar']]}, 'baz']]} self.assertEqual('foo bar\nbaz', self.resolve(raw)) + def test_join_not_string(self): + snippet = {'Fn::Join': ['\n', [{'Fn::Join': + [' ', ['foo', 45]]}, 'baz']]} + error = self.assertRaises(TypeError, + self.resolve, + snippet) + self.assertIn('45', six.text_type(error)) + def test_base64_replace(self): raw = {'Fn::Base64': {'Fn::Replace': [ {'foo': 'bar'}, 'Meet at the foo']}}