import jinja2


def render(data, template):
    """render jija2 template

    Args:
      data(obj): dict with data to pass to jinja2 template
      template(str): jinja2 template to use

    Returns: string, rendered all, or pukes with error :)

    """
    with open(template, 'r'):
        templateLoader = jinja2.FileSystemLoader(searchpath="./")
        templateEnv = jinja2.Environment(loader=templateLoader)
        template = templateEnv.get_template(template)
        outputText = template.render(data=data)
        return outputText