Updated to use new hw_diags.py
This commit is contained in:
parent
fad65b8df6
commit
ad9662c120
1 changed files with 28 additions and 24 deletions
|
|
@ -10,30 +10,34 @@ import time
|
||||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||||
sys.path.append(os.getcwd())
|
sys.path.append(os.getcwd())
|
||||||
from functions.hw_diags import *
|
from functions.hw_diags import *
|
||||||
#init_global_vars()
|
init_global_vars()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
# Prep
|
# Prep
|
||||||
clear_screen()
|
clear_screen()
|
||||||
dev_path = sys.argv[1]
|
state = State()
|
||||||
devs = scan_disks(True, dev_path)
|
state.init()
|
||||||
|
|
||||||
# Warn if SMART unavailable
|
# Find disk
|
||||||
if dev_path not in devs:
|
disk = None
|
||||||
print_error('SMART data not available')
|
for d in state.disks:
|
||||||
exit_script()
|
if d.path == sys.argv[1]:
|
||||||
|
disk = d
|
||||||
|
|
||||||
# Initial screen
|
# Show details
|
||||||
dev = devs[dev_path]
|
clear_screen()
|
||||||
clear_screen()
|
if disk:
|
||||||
show_disk_details(dev, only_attributes=True)
|
for line in disk.generate_attribute_report(timestamp=True):
|
||||||
|
print(line)
|
||||||
|
else:
|
||||||
|
print_error('Disk "{}" not found'.format(sys.argv[1]))
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
exit_script()
|
exit_script()
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
major_exception()
|
major_exception()
|
||||||
|
|
||||||
# vim: sts=4 sw=4 ts=4
|
# vim: sts=2 sw=2 ts=2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue