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