Simplified osTicket post formatting
This commit is contained in:
parent
4aa50a044a
commit
9cad5419d8
1 changed files with 5 additions and 13 deletions
|
|
@ -91,24 +91,15 @@ 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))
|
||||||
attr_report = dev.generate_attribute_report()
|
source_report = dev.generate_attribute_report()
|
||||||
source_report = [attr_report.pop(0)]
|
|
||||||
source_report.extend(
|
|
||||||
['... {}'.format(line.strip()) for line in attr_report])
|
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
if dev.nvme_smart_notes:
|
if dev.nvme_smart_notes:
|
||||||
notes = sorted(dev.nvme_smart_notes.keys())
|
|
||||||
source_report.append('{} Notes'.format(dev.attr_type))
|
source_report.append('{} Notes'.format(dev.attr_type))
|
||||||
source_report.extend(
|
source_report.extend(sorted(dev.nvme_smart_notes.keys()))
|
||||||
['... {}'.format(line.strip()) for line in notes])
|
|
||||||
|
|
||||||
# Test Report
|
# Test Report
|
||||||
_report = test.report.copy()
|
source_report.extend(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))
|
||||||
|
|
@ -160,7 +151,8 @@ class osTicket():
|
||||||
line = re.sub(r'(\s+)', ' ', line)
|
line = re.sub(r'(\s+)', ' ', line)
|
||||||
|
|
||||||
# Indent line
|
# Indent line
|
||||||
line = '... {}'.format(line)
|
if not re.match(r'^(NVMe|SMART)', line):
|
||||||
|
line = '... {}'.format(line)
|
||||||
|
|
||||||
# Add line to report
|
# Add line to report
|
||||||
out_report.append(line)
|
out_report.append(line)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue