From f1e29cd0c8170443e2daed480dc1a28e3d6a7219 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 8 Oct 2022 19:30:05 -0700 Subject: [PATCH] Only call gpt under macOS --- scripts/wk/hw/diags.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 100afc35..76dfbf5f 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -6,6 +6,7 @@ import atexit import logging import os import pathlib +import platform import subprocess import time @@ -281,11 +282,12 @@ class State(): for test in disk.tests: _f.write(f'\n{test.name}:\n') _f.write('\n'.join(debug.generate_object_report(test, indent=1))) - cmd = [( - f'sudo gpt -r show "{disk.path}"' - f' >> {debug_dir}/gpt_{disk.path.name}.info' - )] - exe.run_program(cmd, check=False, shell=True) + if platform.system() == 'Darwin': + cmd = [( + f'sudo gpt -r show "{disk.path}"' + f' >> {debug_dir}/gpt_{disk.path.name}.info' + )] + exe.run_program(cmd, check=False, shell=True) # osTicket with open(f'{debug_dir}/osTicket.report', 'a', encoding='utf-8') as _f: