/usr/lib/python3/dist-packages/plainbox/impl/providers/exporters/data/hexr.xml is in python3-plainbox 0.25-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | {%- set ns = '2013.com.canonical.certification::' -%}
{%- set state = manager.default_device_context.state -%}
{%- set job_state_map = state.job_state_map -%}
{%- set hexr_outcome_list = OUTCOME_METADATA_MAP.values()|selectattr('hexr_xml_allowed')|sort(attribute='hexr_xml_order') -%}
<?xml version="1.0"?>
<system version="1.0">
<context>
{%- for job_id in job_state_map|sort %}
{%- set job_state = job_state_map[job_id] %}
{%- if job_state.job.id|strip_ns not in ("dmi_attachment", "sysfs_attachment", "udev_attachment") and job_state.job.plugin == "attachment" and job_state.result.outcome %}
<info command="{{ job_state.job.id|strip_ns }}">{{ job_state.result.io_log_as_text_attachment }}</info>
{%- endif %}
{%- endfor %}
</context>
<hardware>
{%- if ns ~ 'dmi_attachment' in state.job_state_map %}
{%- set dmi_attachment = state.job_state_map[ns ~ 'dmi_attachment'].result.io_log_as_text_attachment %}
<dmi>{{ dmi_attachment }}</dmi>
{%- else %}
<!-- the dmi_attachment job is not available, not producing the <dmi> section -->
{%- endif %}
{%- if ns ~ 'sysfs_attachment' in state.job_state_map %}
{%- set sysfs_attachment = state.job_state_map[ns ~ 'sysfs_attachment'].result.io_log_as_text_attachment %}
<sysfs-attributes>{{ sysfs_attachment }}</sysfs-attributes>
{%- else %}
<!-- the sysfs_attachment job is not available, not producing the <sysfs-attributes> tag -->
{%- endif %}
{%- if ns ~ 'udev_attachment' in state.job_state_map %}
{%- set udev_attachment = state.job_state_map[ns ~ 'udev_attachment'].result.io_log_as_text_attachment %}
<udev>{{ udev_attachment }}</udev>
{%- else %}
<!-- the udev_attachment job is not available, not producing the <udev> tag -->
{%- endif %}
{%- if ns ~ 'cpuinfo' in state.resource_map and state.resource_map[ns ~ 'cpuinfo'][0] %}
{%- set processor_resource = state.resource_map[ns ~ 'cpuinfo'][0] %}
{#- FIXME: The <processors> section is quite broken by design. #}
{#- Yes, it does copy the data for the 0th CPU $count times. #}
<processors>
{%- for dummy_index in range(processor_resource.count|int) %}
<processor id="{{ loop.index0 }}" name="{{ loop.index0 }}">
{%- for key in processor_resource|sort %}
<property name="{{ key }}" type="str">{{ processor_resource[key] }}</property>
{%- endfor %}
</processor>
{%- endfor %}
</processors>
{%- else %}
<!-- cpuinfo resource is not available, not producing the <processors> section -->
{%- endif %}
</hardware>
<questions>
{%- for job_id in job_state_map|sort %}
{%- set job_state = job_state_map[job_id] %}
{%- set job = job_state.job %}
{%- set result = job_state.result %}
{%- if job.plugin not in ("resource", "local", "attachment") and job_state.result.outcome %}
<question{{ {
'name': job.id|strip_ns,
'certification_status': job_state.certification_status,
}|sorted_xmlattr }}>
<answer type="multiple_choice">{{ result.outcome_meta().hexr_xml_mapping }}</answer>
{#- FIXME: Yes the <answer_choices> section is useless #}
<answer_choices>
{%- for outcome_info in hexr_outcome_list %}
<value type="str">{{ outcome_info.hexr_xml_mapping }}</value>
{%- endfor %}
</answer_choices>
{#- FIXME: yes this does munges comments and I/O log #}
<comment>
{%- if result.comments -%}
{{ result.comments }}
{%- else -%}
{{ result.io_log_as_flat_text }}
{%- endif -%}
</comment>
</question>
{%- endif %}
{%- endfor %}
</questions>
<software>
{%- if ns ~ 'lsb' in state.resource_map and state.resource_map[ns ~ 'lsb'][0] %}
{%- set lsb_resource = state.resource_map[ns ~ 'lsb'][0] %}
<lsbrelease>
{%- for key in lsb_resource|sort %}
<property name="{{ key }}" type="str">{{ lsb_resource[key] }}</property>
{%- endfor %}
</lsbrelease>
{%- else %}
<!-- lsb resource is not available, not producing the <lsbrelease> tag -->
{%- endif %}
{%- if ns ~ 'package' in state.resource_map %}
{%- set package_resource_list = state.resource_map[ns ~ 'package'] %}
<packages>
{%- for package_resource in package_resource_list %}
<package id="{{ loop.index0 }}" name="{{ package_resource.name }}">
{%- for key in package_resource|reject('is_name')|sort %}
<property name="{{ key }}" type="str">{{ package_resource[key] }}</property>
{%- endfor %}
</package>
{%- endfor %}
</packages>
{%- else %}
<!-- package resource is not available, not producing the <packages> tag -->
{%- endif %}
{%- if ns ~ 'snap' in state.resource_map %}
{%- set snap_package_resource_list = state.resource_map[ns ~ 'snap'] %}
<snap_packages>
{%- for snap_package_resource in snap_package_resource_list %}
<snap_package id="{{ loop.index0 }}" name="{{ snap_package_resource.name }}">
{%- for key in snap_package_resource|reject('is_name')|sort %}
<property name="{{ key }}" type="str">{{ snap_package_resource[key] }}</property>
{%- endfor %}
</snap_package>
{%- endfor %}
</snap_packages>
{%- endif %}
{%- if ns ~ 'requirements' in state.resource_map %}
{%- set requirement_resource_list = state.resource_map[ns ~ 'requirements'] %}
<requirements>
{%- for requirement_resource in requirement_resource_list %}
<requirement id=" {{ loop.index0 }}" name="{{ requirement_resource.name }}">
{%- for key in requirement_resource|reject('is_name')|sort %}
<property name="{{ key }}" type="str">{{ requirement_resource[key] }}</property>
{%- endfor %}
</requirement>
{%- endfor %}
</requirements>
{%- else %}
<!-- requirements resource is not available, not producing the <requirements> tag -->
{%- endif %}
</software>
<summary>
{#- FIXME: with all the <property> tags those should not be custom #}
<client name="{{ client_name }}" version="{{ client_version }}"/>
<date_created value="{{ timestamp }}"/>
{%- if ns ~ 'dpkg' in state.resource_map and state.resource_map[ns ~ 'dpkg'][0] %}
{%- set dpkg_resource = state.resource_map[ns ~ 'dpkg'][0] %}
<architecture value="{{ dpkg_resource.architecture }}"/>
{%- else %}
<!-- dpkg resource is not available, not producing the <architecture> tag -->
{%- endif %}
{%- if ns ~ 'lsb' in state.resource_map and lsb_resource %}
{#- NOTE: lsb_resource is computed earlier, if the condition above holds #}
<distribution value="{{ lsb_resource.distributor_id }}"/>
<distroseries value="{{ lsb_resource.release }}"/>
{%- else %}
<!-- lsb resource is not available, not producing <distribution> and <distroseries> tags -->
{%- endif %}
{%- if ns ~ 'uname' in state.resource_map and state.resource_map[ns ~ 'uname'][0] %}
{%- set uname_resource = state.resource_map[ns ~ 'uname'][0] %}
<kernel-release value="{{ uname_resource.release }}"/>
{%- else %}
<!-- uname resource is not available, not producing the <kernel-release> tag -->
{%- endif %}
{#- FIXME: yes, this is just hard-coded non-sense #}
<private value="False"/>
<contactable value="False"/>
<live_cd value="False"/>
<system_id value="{{ system_id }}"/>
</summary>
</system>
|