From ffbcf7ebba76c6f2d20e5da6a3449be8b08913fa Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 23 Jun 2020 11:42:26 +0200 Subject: Check return code on restore image command When restore image command was sent and the restoration failed, you could see in WebConsole the image as restored and the command completed, as it if had not failed. This happened because ogClient did not check the return code of restoration script. This commit adds return code check on restore image. So, when return code is a non-zero value ogClient responses with an error 500. When ogServer receives this error response, it did not set in the database the image as restored and command as completed without errors. --- src/linux/ogOperations.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/linux') diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py index 9a806af..7f70f2b 100644 --- a/src/linux/ogOperations.py +++ b/src/linux/ogOperations.py @@ -195,6 +195,8 @@ class OgLinuxOperations: shell=True, executable=OG_SHELL) (output, error) = ogRest.proc.communicate() + if (ogRest.proc.returncode): + raise Exception except: raise ValueError('Error: Incorrect command value') -- cgit v1.2.3-18-g5258