From a1493a827e9eeac5420087c7ae7bbd92d17efae7 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Wed, 9 Apr 2025 17:47:51 +0200 Subject: [PATCH 1/2] refs #1876 change check and improve debug msg --- ogclient/lib/python3/FileSystemLib.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ogclient/lib/python3/FileSystemLib.py b/ogclient/lib/python3/FileSystemLib.py index 1b5a5be..1067ddc 100644 --- a/ogclient/lib/python3/FileSystemLib.py +++ b/ogclient/lib/python3/FileSystemLib.py @@ -692,7 +692,8 @@ def ogReduceFs (disk, par): break elif type == 'NTFS': ogUnmount (disk, par) - nr_lines = subprocess.run (['ntfsresize', '-fi', PART], capture_output=True, text=True).stdout.splitlines() + ntfsresize_out = subprocess.run (['ntfsresize', '-fi', PART], capture_output=True, text=True).stdout + nr_lines = ntfsresize_out.splitlines() maxsize = None size = None for l in nr_lines: @@ -702,12 +703,10 @@ def ogReduceFs (disk, par): size = l.split()[4] size = int ((int (size) * 1.1 / 1024 + 1) * 1024) - if not maxsize and not size: - SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, f'{disk},{par}') + if not maxsize or not size: + SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, f'{disk},{par} ({ntfsresize_out})') return None - import time - extrasize = 0 retval = 1 while retval != 0 and size+extrasize < maxsize: -- 2.40.1 From 44511c79a0bcf73dd672df52b86656bb69f843ad Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Wed, 9 Apr 2025 18:36:11 +0200 Subject: [PATCH 2/2] refs #1876 change check and improve debug msg --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dc7271..df519fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.6] - 2025-04-09 + +### Fixed + +- Fixed ogReduceFs + ## [0.3.5] - 2025-04-09 ### Fixed -- 2.40.1