From f3985f7f6072cddc8246bd7ba1159f83457d58df Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 1 Mar 2024 08:52:15 +0100 Subject: [PATCH] [EDF29576] : Driver intercepts now the invalid return code --- src/yacsloader/driver | 8 ++++++-- src/yacsloader/driver_internal.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/yacsloader/driver b/src/yacsloader/driver index 6d2906204..cbd85b922 100644 --- a/src/yacsloader/driver +++ b/src/yacsloader/driver @@ -52,6 +52,10 @@ if __name__ == "__main__": ior_file = FileDeleter( f.name ) iorStuff = "{}={}".format( driver_internal.IOREntryInCMD, ior_file.filename) argv = [elt for elt in sys.argv[1:] if elt != ""] - proc = sp.Popen( ["python3",driver_internal.__file__] + [ iorStuff ] + argv ) + cmd = ["python3",driver_internal.__file__] + [ iorStuff ] + argv + proc = sp.Popen( cmd ) proc.communicate() - del ior_file \ No newline at end of file + del ior_file + code = proc.returncode + if proc != 0: + raise RuntimeError(f"Subprocess finished with a non zero status ({code}). Command returning non zero status was : {cmd}") diff --git a/src/yacsloader/driver_internal.py b/src/yacsloader/driver_internal.py index ecb484a2f..6c7d54152 100644 --- a/src/yacsloader/driver_internal.py +++ b/src/yacsloader/driver_internal.py @@ -303,7 +303,7 @@ def getArgumentParser(): parser.add_argument("-x",SaveXMLSchemaEntryInCMD, dest=SaveXMLSchemaKeyInARGS, type=str, const="saveSchema.xml", nargs='?', default="", help = "dump xml schema") parser.add_argument("-t",ShutdownEntryInCMD, dest = ShutdownKeyInARGS, type=int , default=3, help="Shutdown the schema: 0=no shutdown to 3=full shutdown") parser.add_argument("-r",ResetEntryInCMD, dest = ResetKeyInARGS, type=int , default = 0, help="Reset the schema before execution: 0=nothing, 1=reset error nodes to ready state") - parser.add_argument("-i",InitPortEntryInCMD, dest = InitPortKeyInARGS, type=str, default ="", help="Initialisation value of a port, specified as bloc.node.port=value.") + parser.add_argument("-i",InitPortEntryInCMD, dest = InitPortKeyInARGS, type=str, default ="", help="Initialisation value of a port, specified as bloc.node.port=value. For multiple settings use comma.") parser.add_argument("-z",DoNotSqueezeEntryInCMD, dest = DoNotSqueezeKeyInARGS, help = "Desactivate squeeze memory optimization.", action='store_true') parser.add_argument(CPUTimeResOfContainerEntryInCMD, dest = CPUTimeResOfContainerKeyInARGS, type=int, default = 10, help="Time in second between two measures of CPU/Mem in container processes") parser.add_argument(HTOPFileEntryInCMD, dest = HTOPFileKeyInARGS, type=str, default ="", help="File name (if not empty) containing the result of measure of current process") -- 2.30.2