Open logs and cleanup
This commit is contained in:
parent
dce31bf5dd
commit
19176d30cf
3 changed files with 23 additions and 7 deletions
|
|
@ -36,7 +36,7 @@ def prep_disk_for_backup(destination, disk, ticket_number):
|
|||
|
||||
# Get partition totals
|
||||
disk['Bad Partitions'] = [par['Number'] for par in disk['Partitions']
|
||||
if is_bad_partition(partition)]
|
||||
if is_bad_partition(par)]
|
||||
num_valid_partitions = len(disk['Partitions']) - len(disk['Bad Partitions'])
|
||||
disk['Valid Partitions'] = num_valid_partitions
|
||||
if disk['Valid Partitions'] <= 0:
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ def run_diskpart(script):
|
|||
global_vars['Env']['SYSTEMDRIVE']),
|
||||
'/s', tempfile]
|
||||
result = run_program(cmd)
|
||||
time.sleep(2)
|
||||
sleep(2)
|
||||
return result
|
||||
|
||||
def scan_disks():
|
||||
|
|
|
|||
|
|
@ -178,10 +178,17 @@ def menu_backup():
|
|||
pass
|
||||
for line in par['Error']:
|
||||
print_error('\t{}'.format(line))
|
||||
time.sleep(30)
|
||||
else:
|
||||
print_success('\nNo errors were encountered during imaging.')
|
||||
time.sleep(5)
|
||||
if 'LogFile' in global_vars:
|
||||
cmd = [
|
||||
global_vars['Tools']['NotepadPlusPlus'],
|
||||
global_vars['LogFile']]
|
||||
try:
|
||||
popen_program(cmd)
|
||||
except Exception:
|
||||
print_error('ERROR: Failed to open log.')
|
||||
sleep(30)
|
||||
pause('\nPress Enter to return to main menu... ')
|
||||
|
||||
def menu_root():
|
||||
|
|
@ -219,7 +226,7 @@ def menu_root():
|
|||
elif (selection == 'S'):
|
||||
run_program(['wpeutil', 'shutdown'])
|
||||
else:
|
||||
exit_script()
|
||||
sys.exit()
|
||||
|
||||
def menu_setup():
|
||||
"""Format a disk (MBR/GPT), apply a Windows image, and setup boot files."""
|
||||
|
|
@ -346,6 +353,15 @@ def menu_setup():
|
|||
|
||||
# Print summary
|
||||
print_standard('\nDone.')
|
||||
if 'LogFile' in global_vars:
|
||||
cmd = [
|
||||
global_vars['Tools']['NotepadPlusPlus'],
|
||||
global_vars['LogFile']]
|
||||
try:
|
||||
popen_program(cmd)
|
||||
except Exception:
|
||||
print_error('ERROR: Failed to open log.')
|
||||
sleep(30)
|
||||
pause('\nPress Enter to return to main menu... ')
|
||||
|
||||
def menu_tools():
|
||||
|
|
@ -371,7 +387,7 @@ def menu_tools():
|
|||
popen_program(cmd)
|
||||
except Exception:
|
||||
print_error('Failed to run {}'.format(name))
|
||||
time.sleep(2)
|
||||
sleep(2)
|
||||
pause()
|
||||
elif (selection == 'M'):
|
||||
break
|
||||
|
|
@ -395,7 +411,7 @@ def select_minidump_path():
|
|||
# Check results before showing menu
|
||||
if len(dumps) == 0:
|
||||
print_error(' No BSoD / MiniDump paths found')
|
||||
time.sleep(2)
|
||||
sleep(2)
|
||||
return None
|
||||
|
||||
# Menu
|
||||
|
|
|
|||
Loading…
Reference in a new issue