diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 2deecbd0..45cb8575 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -448,10 +448,20 @@ def post_drive_results(ticket_number): s_table = {a.get('id', 'Unknown'): a for a in s_table} for attrib in sorted(ATTRIBUTES['SMART'].keys()): if attrib in s_table: - report.append('{:0>2}/{:24}{} ({})'.format( - str(hex(int(attrib))).upper()[2:], - attrib, + # Pad attributewith dots for osTicket + hex_str = '{:>2}'.format(str(hex(int(attrib))).upper()[2:]) + hex_str = hex_str.replace(' ', '..') + if '.' in hex_str: + hex_str = '.' + hex_str + dec_str = '{:>3}'.format(attrib) + dec_str = dec_str.replace(' ', '..') + if '.' in dec_str: + dec_str = '.' + dec_str + report.append('{:>2}/{:>3}: {} {} ({})'.format( + hex_str, + dec_str, s_table[attrib]['raw']['string'], + '..'*24+'.', s_table[attrib]['name'], )) report[-1] = report[-1].strip().replace(' ', '.') @@ -489,6 +499,9 @@ def post_drive_results(ticket_number): line = line.strip() if not line: continue + # Strip colors from line + for c in COLORS.values(): + line = line.replace(c, '') report.append(line) report.append('')