summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-09-14 09:54:06 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-09-14 17:12:14 +0200
commit91077da273215596f07b7ebc858633dca350ad30 (patch)
treec3578c20417fbfcc7edf382f2f847664eab117c0 /src/utils
parentcb0bd3d194ddd4ecaab8e671444f1bf7abc8f908 (diff)
utils: minor fix for ogReduceFs and ogExtendFs
Do not return the subprocess result for ogReduceFs/ogExtendFs. ogReduceFs works with or without the target filesystem mounted. ogExtendFs requires the target filesystem to be mounted. 'ogMount' legacy script invocation should be replaced by a better mount/umount wrapper.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/fs.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py
index cd58383..bce6022 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -82,21 +82,21 @@ def ogReduceFs(disk, part):
Bash function 'ogReduceFs' wrapper
"""
proc = subprocess.run(f'ogReduceFs {disk} {part}',
- shell=True, stdout=PIPE)
-
- if proc.returncode == 0:
- subprocess.run(f'ogUnmount {disk} {part}',
- shell=True, stdout=PIPE)
- return proc.stdout.decode().replace('\n', '')
-
- logging.warn(f'ogReduceFS exited with code {proc.returncode}')
- return None
+ shell=True, stdout=PIPE,
+ encoding='utf-8')
+ if proc.returncode != 0:
+ logging.warn(f'ogReduceFS exited with non zero code: {proc.returncode}')
+ subprocess.run(f'ogUnmount {disk} {part}',
+ shell=True)
def ogExtendFs(disk, part):
"""
Bash function 'ogExtendFs' wrapper
"""
+ subprocess.run(f'ogMount {disk} {part}',
+ shell=True)
proc = subprocess.run(f'ogExtendFs {disk} {part}',
shell=True)
- return proc.returncode
+ if proc.returncode != 0:
+ logging.warn(f'ogExtendFs exited with non zero code: {proc.returncode}')