diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-04-19 11:28:39 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-04-19 11:29:24 +0200 |
commit | db23ea76f94e6e6ecc683b5cf3dbec0a224af881 (patch) | |
tree | 35de628c4073c7f040031ff3ac55cc686f9125ad | |
parent | e19437290d9b442789164d72bbfd55e35fef6e0b (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.py | 5 |
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 |