diff --git a/CHANGELOG.md b/CHANGELOG.md index 18e8db1..64f5aea 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.6.1] - 2025-04-15 + +### Fixed + +- Fixed capturing of partclone output and management of return value + ## [0.6.0] - 2025-04-15 ### Changed diff --git a/ogclient/lib/python3/ImageLib.py b/ogclient/lib/python3/ImageLib.py index 5cfcbaf..621924e 100644 --- a/ogclient/lib/python3/ImageLib.py +++ b/ogclient/lib/python3/ImageLib.py @@ -512,6 +512,8 @@ def ogRestoreImage (repo, imgpath, disk, par): rc = None try: p = subprocess.run (program, shell=True, capture_output=True, text=True) + print (p.stdout) + print (p.stderr) rc = p.returncode if not rc: SystemLib.ogRaiseError ([], ogGlobalsOG_ERR_IMAGE, f'{imgfile}, {disk}, {par}') diff --git a/ogclient/scripts/deployImage.py b/ogclient/scripts/deployImage.py index e5a2ec2..4070fb4 100755 --- a/ogclient/scripts/deployImage.py +++ b/ogclient/scripts/deployImage.py @@ -145,6 +145,10 @@ def main (repo, imgname, disk, par, proto='UNICAST', protoopt=''): SystemLib.ogEcho (['log', 'session'], None, f'[55] {ogGlobals.lang.MSG_HELP_ogRestoreImage}: restoreImage {params}') retval = subprocess.run (['restoreImage.py'] + params).returncode + ## turn shell's success into python success (without ending up with True or False) + if retval: retval = 0 + else: retval = 1 + # Mostrar resultados. resumerestoreimage = subprocess.run (['grep', '--max-count', '1', 'Total Time:', ogGlobals.OGLOGCOMMAND], capture_output=True, text=True).stdout SystemLib.ogEcho (['log', 'session'], None, f' [ ] {resumerestoreimage} ')