Avoid crash described in issue #39

This commit is contained in:
2Shirt 2018-09-12 16:15:15 -06:00
parent 83064d7c90
commit 56e354f124
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -271,6 +271,7 @@ def run_badblocks():
print_standard('Done', timestamp=False)
# Check results
if os.path.exists(progress_file):
with open(progress_file, 'r') as f:
text = f.read()
TESTS['badblocks']['Results'][name] = text
@ -283,6 +284,8 @@ def run_badblocks():
# Move temp file
shutil.move(progress_file, '{}/badblocks-{}.log'.format(
global_vars['LogDir'], name))
else:
TESTS['badblocks']['Status'][name] = 'NS'
update_progress()
# Done