From 928dedfeeb3946391938d21beb082bee855d69b3 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Fri, 6 Jun 2025 13:57:33 +0200 Subject: [PATCH 1/2] refs #2187 fix rc management in deployImage.py --- CHANGELOG.md | 6 ++++++ ogclient/scripts/deployImage.py | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1daecfe..af851fe 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.14.1] - 2025-06-07 + +### Fixed + +- Fixed rc management in deployImage.py + ## [0.14.0] - 2025-06-07 ### Changed diff --git a/ogclient/scripts/deployImage.py b/ogclient/scripts/deployImage.py index a2d36be..0fcc550 100755 --- a/ogclient/scripts/deployImage.py +++ b/ogclient/scripts/deployImage.py @@ -140,14 +140,10 @@ def main (repo, imgname, disk, par, proto='UNICAST', protoopt=''): # Si existe, ejecuta script personalizado "restoreImageCustom"; si no, llama al genérico "restoreImage". if shutil.which ('restoreImageCustom'): SystemLib.ogEcho (['log', 'session'], None, f'[55] {ogGlobals.lang.MSG_HELP_ogRestoreImage}: restoreImageCustom {params}') - retval = subprocess.run (['restoreImageCustom'] + params).returncode + retval = not subprocess.run (['restoreImageCustom'] + params).returncode else: 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 + retval = not subprocess.run (['restoreImage.py'] + params).returncode # Mostrar resultados. resumerestoreimage = subprocess.run (['grep', '--max-count', '1', 'Total Time:', ogGlobals.OGLOGCOMMAND], capture_output=True, text=True).stdout @@ -176,6 +172,9 @@ def main (repo, imgname, disk, par, proto='UNICAST', protoopt=''): # Registro de fin de ejecución # Si se ha llamado desde ejecutar script no lo muestro para no repetir. if SystemLib.ogGetCaller() != 'EjecutarScript': + ## turn shell's success into python success (without ending up with True or False, because later we want to ogEcho() "0"/"1" rather than ogEcho() "True"/"False") + if retval: retval = 0 + else: retval = 1 SystemLib.ogEcho (['log', 'session'], None, f'{ogGlobals.lang.MSG_INTERFACE_END} {retval}') sys.exit (retval) -- 2.40.1 From 4061f85704a3e76fe87a91cf92d4a58015762ee2 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Fri, 6 Jun 2025 13:58:14 +0200 Subject: [PATCH 2/2] refs #2187 fix rc management in deployImage.py --- ogclient/scripts/deployImage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogclient/scripts/deployImage.py b/ogclient/scripts/deployImage.py index 0fcc550..83ccafa 100755 --- a/ogclient/scripts/deployImage.py +++ b/ogclient/scripts/deployImage.py @@ -172,7 +172,7 @@ def main (repo, imgname, disk, par, proto='UNICAST', protoopt=''): # Registro de fin de ejecución # Si se ha llamado desde ejecutar script no lo muestro para no repetir. if SystemLib.ogGetCaller() != 'EjecutarScript': - ## turn shell's success into python success (without ending up with True or False, because later we want to ogEcho() "0"/"1" rather than ogEcho() "True"/"False") + ## turn shell's success into python success (without ending up with True or False, because we want to ogEcho() "0"/"1" rather than ogEcho() "True"/"False") if retval: retval = 0 else: retval = 1 SystemLib.ogEcho (['log', 'session'], None, f'{ogGlobals.lang.MSG_INTERFACE_END} {retval}') -- 2.40.1