From bf7eb1542ddb802020dd3bce0fa9e3972474c8b9 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Thu, 15 Feb 2024 10:42:10 +0100 Subject: fs: logging ext4 resize error log error in case resize2fs fails. --- src/utils/fs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/fs.py b/src/utils/fs.py index 4fd431e..77f8b75 100644 --- a/src/utils/fs.py +++ b/src/utils/fs.py @@ -207,9 +207,11 @@ def _reduce_resize2fs(partdev): cmd = shlex.split(f'resize2fs -fpM {partdev}') with open('/tmp/command.log', 'ab', 0) as logfile: proc = subprocess.run(cmd, stdout=logfile, stderr=STDOUT) - ret = proc.returncode + if proc.returncode != 0: + logging.error('failed to resize {partdev} with ext4') + return -1 - return 0 if ret == 0 else -1 + return 0 def _reduce_ntfsresize(partdev): -- cgit v1.2.3-18-g5258