summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-04-19 11:28:39 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-04-19 11:29:24 +0200
commitdb23ea76f94e6e6ecc683b5cf3dbec0a224af881 (patch)
tree35de628c4073c7f040031ff3ac55cc686f9125ad
parente19437290d9b442789164d72bbfd55e35fef6e0b (diff)
utils: fs: set return value in ogReduceFs
otherwise error path uses uninitialized variable File "/opt/opengnsys/ogClient/src/utils/fs.py", line 112, in ogReduceFs return ret UnboundLocalError: local variable 'ret' referenced before assignment
-rw-r--r--src/utils/fs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py
index 83d8d47..2d98dc1 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -105,8 +105,9 @@ def ogReduceFs(disk, part):
elif fstype == 'ntfs':
ret = _reduce_ntfsresize(partdev)
else:
- logging.warn(f'Unable to shrink filesystem at {partdev}. '
- f'Unsupported filesystem "{fstype}".')
+ ret = -1
+ logging.error(f'Unable to shrink filesystem at {partdev}. '
+ f'Unsupported filesystem "{fstype}".')
return ret