'Get template file contents, either from local file or URL.'

def _get_template(self, req):

    if ('TemplateBody' in req.params):
        LOG.debug('TemplateBody    ...')
        return req.params['TemplateBody']
    elif ('TemplateUrl' in req.params):
        url = req.params['TemplateUrl']
        LOG.debug(('TemplateUrl    %s' % url))
        try:
            return urlfetch.get(url)
        except IOError as exc:
            msg = (_('Failed    to    fetch    template:    %s') % exc)
            raise exception.HeatInvalidParameterValueError(detail=msg)
    return None
