Renders a policy from a jinja template

def _generate_inline_policy(self):
        """Renders a policy from a jinja template"""
        template_name = self._locate_file('deny-sts-before-time.json.j2')
        template_file = open(template_name)
        template_contents = template_file.read()
        template_file.close()
        jinja_template = Template(template_contents)
        policy_document = jinja_template.render(
            before_date=self._get_date()
        )
        return policy_document