sos.report.reporting — Reporting Interface

This provides a restricted tag language to define the sos report index/report

class sos.report.reporting.Alert(content)[source]

Bases: Leaf

ADDS_TO = 'alerts'
class sos.report.reporting.Command(name, return_code, href)[source]

Bases: Leaf

ADDS_TO = 'commands'
class sos.report.reporting.CopiedFile(name, href)[source]

Bases: Leaf

ADDS_TO = 'copied_files'
class sos.report.reporting.CreatedFile(name, href)[source]

Bases: Leaf

ADDS_TO = 'created_files'
class sos.report.reporting.HTMLReport(report_node)[source]

Bases: PlainTextReport

Will 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)s">Plugin <em>%(name)s</em></h2>'
PLUGLISTFOOTER = '</tr></table>'
PLUGLISTHEADER = '<h3>Loaded Plugins:</h3><table><tr>'
PLUGLISTITEM = '<td><a href="#%(name)s">%(name)s</a></td>\n'
PLUGLISTMAXITEMS = 5
PLUGLISTSEP = '</tr>\n<tr>'
subsections = ((<class 'sos.report.reporting.Command'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Commands executed:</p><ul>', '</ul>'), (<class 'sos.report.reporting.CopiedFile'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Files copied:</p><ul>', '</ul>'), (<class 'sos.report.reporting.CreatedFile'>, '<li><a href="%(href)s">%(name)s</a></li>', '<p>Files created:</p><ul>', '</ul>'), (<class 'sos.report.reporting.Alert'>, '<li>%s</li>', '<p>Alerts:</p><ul>', '</ul>'), (<class 'sos.report.reporting.Note'>, '<li>%s</li>', '<p>Notes:</p><ul>', '</ul>'))
class sos.report.reporting.JSONReport(report_node)[source]

Bases: PlainTextReport

Will generate a JSON report from a top_level Report object

unicode()[source]
class sos.report.reporting.Leaf[source]

Bases: Node

Marker class that can be added to a Section node

class sos.report.reporting.Node[source]

Bases: object

can_add(node)[source]
data = {}
class sos.report.reporting.Note(content)[source]

Bases: Leaf

ADDS_TO = 'notes'
class sos.report.reporting.PlainTextReport(report_node)[source]

Bases: object

Will generate a plain text report from a top_level Report object

ALERT = '  ! %s'
FOOTER = ''
HEADER = ''
LEAF = '  * %(name)s'
NOTE = '  * %s'
PLUGDIVIDER = '========================================================================'
PLUGINFORMAT = '%(name)s'
PLUGLISTFOOTER = ''
PLUGLISTHEADER = 'Loaded Plugins:'
PLUGLISTITEM = '  %(name)s'
PLUGLISTMAXITEMS = 5
PLUGLISTSEP = '\n'
line_buf = []
process_subsection(section, key, header, format_, footer)[source]
subsections = ((<class 'sos.report.reporting.Command'>, '  * %(name)s', '-  commands executed:', ''), (<class 'sos.report.reporting.CopiedFile'>, '  * %(name)s', '-  files copied:', ''), (<class 'sos.report.reporting.CreatedFile'>, '  * %(name)s', '-  files created:', ''), (<class 'sos.report.reporting.Alert'>, '  ! %s', '-  alerts:', ''), (<class 'sos.report.reporting.Note'>, '  * %s', '-  notes:', ''))
unicode()[source]
class sos.report.reporting.Report[source]

Bases: Node

The root element of a report. This is a container for sections.

add(*nodes)[source]
can_add(node)[source]
class sos.report.reporting.Section(name)[source]

Bases: Node

A section is a container for leaf elements. Sections may be nested inside of Report objects only.

add(*nodes)[source]
can_add(node)[source]
sos.report.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’