plainbox.impl.exporter.xml

XML exporter for certification website

Warning

THIS MODULE DOES NOT HAVE A STABLE PUBLIC API

class plainbox.impl.exporter.xml.XMLSessionStateExporter(option_list=None, system_id=None, timestamp=None, client_version=None, client_name='plainbox')[source]

Bases: plainbox.impl.exporter.SessionStateExporterBase

Session state exporter creating XML documents

The following resource jobs are needed to validate sections of this report:
  • 2013.com.canonical.certification::package (Optional)
  • 2013.com.canonical.certification::uname (Optional)
  • 2013.com.canonical.certification::lsb (Mandatory)
  • 2013.com.canonical.certification::cpuinfo (Mandatory)
  • 2013.com.canonical.certification::dpkg (Mandatory)
The Hardware sections includes the content of the following attachments:
  • 2013.com.canonical.certification::dmi_attachment
  • 2013.com.canonical.certification::sysfs_attachment
  • 2013.com.canonical.certification::udev_attachment
NS = '2013.com.canonical.certification::'
OPTION_CLIENT_NAME = 'client-name'
OPTION_FLATTEN_IO_LOG = 'flatten-io-log'
OPTION_SQUASH_IO_LOG = 'squash-io-log'
OPTION_WITH_ATTACHMENTS = 'with-attachments'
OPTION_WITH_CATEGORY_MAP = 'with-category-map'
OPTION_WITH_CERTIFICATION_STATUS = 'with-certification-status'
OPTION_WITH_COMMENTS = 'with-comments'
OPTION_WITH_DESIRED_JOB_LIST = 'with-job-list'
OPTION_WITH_IO_LOG = 'with-io-log'
OPTION_WITH_JOB_DEFS = 'with-job-defs'
OPTION_WITH_JOB_HASH = 'with-job-hash'
OPTION_WITH_JOB_LIST = 'with-job-list'
OPTION_WITH_JOB_VIA = 'with-job-via'
OPTION_WITH_RESOURCE_MAP = 'with-resource-map'
OPTION_WITH_RUN_LIST = 'with-run-list'
SUPPORTED_OPTION_LIST = ('client-name', 'with-certification-status')
dump(data, stream)[source]

Public method to dump the XML report to a stream

get_option_value(option)

Returns the value assigned to an option.

get_resource(data, partial_id)[source]

Get resource with the specified partial_id

Parameters:
  • data – data obtained from get_session_data_subset()
  • partial_id – partial identifier of the resuorce job
Returns:

List of resource objects or None. Does not return empty lists.

get_root_element(data)[source]

Get the XML element of the document exported from the given data

get_session_data_subset(session)

Compute a subset of session data.

The subset of the data that should be saved may depend on a particular saver class and options selected by the user.

Must return a collection that can be handled by dump(). Special care must be taken when processing io_log (and in the future, attachments) as those can be arbitrarily large.

set_option_value(option, value=True)

assigns a value to an option. If no value is given, it just “sets” the option to True

supported_option_list = ('client-name', 'with-certification-status')
class plainbox.impl.exporter.xml.XMLValidator[source]

Bases: builtins.object

A validator for documents produced by XMLSessionStateExporter

validate_element(element)[source]

Validate the given element

Parameters:element – lxml.etree.ElementTree.Element to validate
Returns:True, if the document is valid
validate_text(text)[source]

Validate the given text

Parameters:text – text to validate

Previous topic

plainbox.impl.exporter.text – plain text exporter

Next topic

plainbox.impl.highlevel – High-level API

This Page