toscaparser: Avoid exception when creating our own
[parser.git] / tosca2heat / tosca-parser / toscaparser / elements / tosca_type_validation.py
index 89a6a03..8b49f48 100644 (file)
@@ -49,12 +49,12 @@ class TypeValidation(object):
         for name in custom_type:
             if name not in self.ALLOWED_TYPE_SECTIONS:
                 ExceptionCollector.appendException(
-                    UnknownFieldError(what='Template ' + (self.import_def),
+                    UnknownFieldError(what='Template ' + str(self.import_def),
                                       field=name))
 
     def _validate_type_version(self, version):
         if version not in self.VALID_TEMPLATE_VERSIONS:
             ExceptionCollector.appendException(
                 InvalidTemplateVersion(
-                    what=version + ' in ' + self.import_def,
+                    what=version + ' in ' + str(self.import_def),
                     valid_versions=', '. join(self.VALID_TEMPLATE_VERSIONS)))