parent
e0c3716e08
commit
809f338cd2
1 changed files with 17 additions and 4 deletions
|
|
@ -81,8 +81,9 @@ class osTicket():
|
||||||
|
|
||||||
def convert_report(self, name, test):
|
def convert_report(self, name, test):
|
||||||
"""Convert report into an osTicket friendly format, returns list."""
|
"""Convert report into an osTicket friendly format, returns list."""
|
||||||
|
dev = test.dev
|
||||||
out_report = []
|
out_report = []
|
||||||
source_report = test.report
|
source_report = test.report.copy()
|
||||||
status = strip_colors(test.status)
|
status = strip_colors(test.status)
|
||||||
status = status.replace(test.label, '').strip()
|
status = status.replace(test.label, '').strip()
|
||||||
|
|
||||||
|
|
@ -90,9 +91,21 @@ class osTicket():
|
||||||
index = 1
|
index = 1
|
||||||
if name == 'NVMe / SMART':
|
if name == 'NVMe / SMART':
|
||||||
out_report.append('{} ({})'.format(name, status))
|
out_report.append('{} ({})'.format(name, status))
|
||||||
if not source_report:
|
source_report = dev.generate_attribute_report()
|
||||||
index = 0
|
|
||||||
source_report = test.dev.generate_attribute_report()
|
# Notes
|
||||||
|
if dev.nvme_smart_notes:
|
||||||
|
notes = sorted(dev.nvme_smart_notes.keys())
|
||||||
|
source_report.append('{} Notes'.format(dev.attr_type))
|
||||||
|
source_report.extend(
|
||||||
|
['..... {}'.format(line.strip()) for line in notes])
|
||||||
|
|
||||||
|
# Test Report
|
||||||
|
_report = test.report.copy()
|
||||||
|
if _report:
|
||||||
|
source_report.append(_report.pop(0))
|
||||||
|
source_report.extend(
|
||||||
|
['..... {}'.format(line.strip()) for line in _report])
|
||||||
elif not source_report:
|
elif not source_report:
|
||||||
index = 0
|
index = 0
|
||||||
out_report.append('{} ({})'.format(name, status))
|
out_report.append('{} ({})'.format(name, status))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue