Adjusted osTicket post formatting
This commit is contained in:
parent
d447e694b2
commit
4aa50a044a
1 changed files with 12 additions and 4 deletions
|
|
@ -91,21 +91,24 @@ 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))
|
||||||
source_report = dev.generate_attribute_report()
|
attr_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())
|
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(
|
||||||
['..... {}'.format(line.strip()) for line in notes])
|
['... {}'.format(line.strip()) for line in notes])
|
||||||
|
|
||||||
# Test Report
|
# Test Report
|
||||||
_report = test.report.copy()
|
_report = test.report.copy()
|
||||||
if _report:
|
if _report:
|
||||||
source_report.append(_report.pop(0))
|
source_report.append(_report.pop(0))
|
||||||
source_report.extend(
|
source_report.extend(
|
||||||
['..... {}'.format(line.strip()) for line in _report])
|
['... {}'.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))
|
||||||
|
|
@ -132,6 +135,8 @@ class osTicket():
|
||||||
line = '{}{} {}'.format(_sensor, _spacer, _temps)
|
line = '{}{} {}'.format(_sensor, _spacer, _temps)
|
||||||
if line == 'Temps':
|
if line == 'Temps':
|
||||||
out_report.append(' ')
|
out_report.append(' ')
|
||||||
|
out_report.append('Temps')
|
||||||
|
continue
|
||||||
elif name == 'NVMe / SMART':
|
elif name == 'NVMe / SMART':
|
||||||
r = REGEX_NVME_SMART_ATTRIBUTES.match(line)
|
r = REGEX_NVME_SMART_ATTRIBUTES.match(line)
|
||||||
if r:
|
if r:
|
||||||
|
|
@ -154,6 +159,9 @@ class osTicket():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
line = re.sub(r'(\s+)', ' ', line)
|
line = re.sub(r'(\s+)', ' ', line)
|
||||||
|
|
||||||
|
# Indent line
|
||||||
|
line = '... {}'.format(line)
|
||||||
|
|
||||||
# Add line to report
|
# Add line to report
|
||||||
out_report.append(line)
|
out_report.append(line)
|
||||||
|
|
||||||
|
|
@ -286,7 +294,7 @@ class osTicket():
|
||||||
v_data[-1] = re.sub(r'\.*$', '', v_data[-1])
|
v_data[-1] = re.sub(r'\.*$', '', v_data[-1])
|
||||||
v_data = [v.replace('_', ' ') for v in v_data]
|
v_data = [v.replace('_', ' ') for v in v_data]
|
||||||
report.append(
|
report.append(
|
||||||
'{}..{}..Total..{}..({}..Used..{}..Free..{})'.format(*v_data))
|
'... {}..{}..Total..{}..({}..Used..{}..Free..{})'.format(*v_data))
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
return report
|
return report
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue