summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-15 10:42:10 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-15 16:58:51 +0100
commitbf7eb1542ddb802020dd3bce0fa9e3972474c8b9 (patch)
tree6eaedbf1350f910f3c8580d1a3646faa0c059dbd
parentd6c32bba5d3d91f6917b2c856f571964fb725323 (diff)
fs: logging ext4 resize error
log error in case resize2fs fails.
-rw-r--r--src/utils/fs.py6
1 files 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):