예제 #1
0
    def description(self):
        """
        Provide an HTML description of the object for change emails and the Jinja templates.
        :return: string of HTML desribing the object.
        """
        ret = u"<h2>{0.account}/{0.region}/{1}:</h2><br/>".format(self, self.name)
        pdiff = PolicyDiff(self.new_config, self.old_config)
        ret += pdiff.produceDiffHTML()
        if len(self.audit_issues) > 0:
            ret += "<h3>Audit Items: {}</h3>".format(len(self.audit_issues))
            for issue in self.audit_issues:
                ret += "Score: {}<br/>".format(issue.score)
                ret += "Issue: {}<br/>".format(issue.issue)
                ret += "Notes: {}<br/>".format(issue.notes)
                if issue.justified:
                    ret += "Justification: {} on {} by {}<br/>".format(issue.justification, issue.justified_date, issue.user.name)
                ret += "<br/>"

        return ret
예제 #2
0
    def description(self):
        """
        Provide an HTML description of the object for change emails and the Jinja templates.
        :return: string of HTML desribing the object.
        """
        ret = u"<h2>{0.account}/{0.region}/{1}:</h2><br/>".format(
            self, self.name)
        pdiff = PolicyDiff(self.new_config, self.old_config)
        ret += pdiff.produceDiffHTML()
        if len(self.audit_issues) > 0:
            ret += "<h3>Audit Items: {}</h3>".format(len(self.audit_issues))
            for issue in self.audit_issues:
                ret += "Score: {}<br/>".format(issue.score)
                ret += "Issue: {}<br/>".format(issue.issue)
                ret += "Notes: {}<br/>".format(issue.notes)
                if issue.justified:
                    ret += "Justification: {} on {} by {}<br/>".format(
                        issue.justification, issue.justified_date,
                        issue.user.name)
                ret += "<br/>"

        return ret
예제 #3
0
 def get_pdiff_html(self):
     pdiff = PolicyDiff(self.new_config, self.old_config)
     return pdiff.produceDiffHTML()
예제 #4
0
 def get_pdiff_html(self):
     pdiff = PolicyDiff(self.new_config, self.old_config)
     return pdiff.produceDiffHTML()