From db23ea76f94e6e6ecc683b5cf3dbec0a224af881 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 19 Apr 2024 11:28:39 +0200 Subject: 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 --- src/utils/fs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/utils') 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 -- cgit v1.2.3-18-g5258