refs #1876 change check and improve debug msg

pull/23/head
Natalia Serrano 2025-04-09 17:47:51 +02:00
parent 0352e3a2cc
commit a1493a827e
1 changed files with 4 additions and 5 deletions

View File

@ -692,7 +692,8 @@ def ogReduceFs (disk, par):
break
elif type == 'NTFS':
ogUnmount (disk, par)
nr_lines = subprocess.run (['ntfsresize', '-fi', PART], capture_output=True, text=True).stdout.splitlines()
ntfsresize_out = subprocess.run (['ntfsresize', '-fi', PART], capture_output=True, text=True).stdout
nr_lines = ntfsresize_out.splitlines()
maxsize = None
size = None
for l in nr_lines:
@ -702,12 +703,10 @@ def ogReduceFs (disk, par):
size = l.split()[4]
size = int ((int (size) * 1.1 / 1024 + 1) * 1024)
if not maxsize and not size:
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, f'{disk},{par}')
if not maxsize or not size:
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, f'{disk},{par} ({ntfsresize_out})')
return None
import time
extrasize = 0
retval = 1
while retval != 0 and size+extrasize < maxsize: