sos.reporting — Reporting Interface¶
This provides a restricted tag language to define the sosreport index/report
-
class
sos.reporting.Alert(content)[source] Bases:
sos.reporting.Leaf-
ADDS_TO= 'alerts'
-
-
class
sos.reporting.Command(name, return_code, href)[source] Bases:
sos.reporting.Leaf-
ADDS_TO= 'commands'
-
-
class
sos.reporting.CopiedFile(name, href)[source] Bases:
sos.reporting.Leaf-
ADDS_TO= 'copied_files'
-
-
class
sos.reporting.CreatedFile(name, href)[source] Bases:
sos.reporting.Leaf-
ADDS_TO= 'created_files'
-
-
class
sos.reporting.HTMLReport(report_node)[source] Bases:
sos.reporting.PlainTextReportWill generate a HTML report from a top_level Report object
-
ALERT= '<li>%s</li>'
-
FOOTER= '</body></html>'
-
HEADER= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n <head>\n <meta http-equiv="Content-Type" content="text/html;\n charset=utf-8" />\n <title>Sos System Report</title>\n <style type="text/css">\n td {\n padding: 0 5px;\n }\n </style>\n </head>\n <body>\n'
-
LEAF= '<li><a href="%(href)s">%(name)s</a></li>'
-
NOTE= '<li>%s</li>'
-
PLUGDIVIDER= '<hr/>\n'
-
PLUGINFORMAT= '<h2 id="{name}">Plugin <em>{name}</em></h2>'
-
PLUGLISTFOOTER= '</tr></table>'
-
PLUGLISTHEADER= '<h3>Loaded Plugins:</h3><table><tr>'
-
PLUGLISTITEM= '<td><a href="#{name}">{name}</a></td>\n'
-
PLUGLISTMAXITEMS= 5
-
PLUGLISTSEP= '</tr>\n<tr>'
-
subsections= ((<class 'sos.reporting.Command'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Commands executed:</p><ul>', '</ul>'), (<class 'sos.reporting.CopiedFile'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Files copied:</p><ul>', '</ul>'), (<class 'sos.reporting.CreatedFile'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Files created:</p><ul>', '</ul>'), (<class 'sos.reporting.Alert'>, '<li>%s</li>', '<p>Alerts:</p><ul>', '</ul>'), (<class 'sos.reporting.Note'>, '<li>%s</li>', '<p>Notes:</p><ul>', '</ul>'))
-
-
class
sos.reporting.JSONReport(report_node)[source] Bases:
sos.reporting.PlainTextReportWill generate a JSON report from a top_level Report object
-
unicode()[source]
-
-
class
sos.reporting.Leaf[source] Bases:
sos.reporting.NodeMarker class that can be added to a Section node
-
class
sos.reporting.Note(content)[source] Bases:
sos.reporting.Leaf-
ADDS_TO= 'notes'
-
-
class
sos.reporting.PlainTextReport(report_node)[source] Bases:
objectWill generate a plain text report from a top_level Report object
-
ALERT= ' ! %s'
-
FOOTER= ''
-
HEADER= ''
-
LEAF= ' * %(name)s'
-
NOTE= ' * %s'
-
PLUGDIVIDER= '========================================================================'
-
PLUGINFORMAT= '{name}'
-
PLUGLISTFOOTER= ''
-
PLUGLISTHEADER= 'Loaded Plugins:'
-
PLUGLISTITEM= ' {name}'
-
PLUGLISTMAXITEMS= 5
-
PLUGLISTSEP= '\n'
-
line_buf= []
-
process_subsection(section, key, header, format_, footer)[source]
-
subsections= ((<class 'sos.reporting.Command'>, ' * %(name)s', '- commands executed:', ''), (<class 'sos.reporting.CopiedFile'>, ' * %(name)s', '- files copied:', ''), (<class 'sos.reporting.CreatedFile'>, ' * %(name)s', '- files created:', ''), (<class 'sos.reporting.Alert'>, ' ! %s', '- alerts:', ''), (<class 'sos.reporting.Note'>, ' * %s', '- notes:', ''))
-
unicode()[source]
-
-
class
sos.reporting.Report[source] Bases:
sos.reporting.NodeThe root element of a report. This is a container for sections.
-
add(*nodes)[source]
-
can_add(node)[source]
-
-
class
sos.reporting.Section(name)[source] Bases:
sos.reporting.NodeA section is a container for leaf elements. Sections may be nested inside of Report objects only.
-
add(*nodes)[source]
-
can_add(node)[source]
-
-
sos.reporting.ends_bs(string)[source] Return True if ‘string’ ends with a backslash, and False otherwise.
Define this as a named function for no other reason than that pep8 now forbids binding of a lambda expression to a name:
‘E731 do not assign a lambda expression, use a def’