mirror of https://git.48k.eu/ogclient
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.more_events
parent
cb0bd3d194
commit
91077da273
|
@ -359,8 +359,7 @@ class OgLiveOperations:
|
|||
logging.info(f'partclone process exited with code {p1.returncode}')
|
||||
logging.info(f'lzop process exited with code {p2.returncode}')
|
||||
|
||||
if ogExtendFs(disk, partition) != 0:
|
||||
logging.warn('Error extending filesystem after image creation')
|
||||
ogExtendFs(disk, partition)
|
||||
|
||||
image_info = ogGetImageInfo(image_path)
|
||||
except:
|
||||
|
|
|
@ -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}')
|
||||
|
|
Loading…
Reference in New Issue