From baa03debd7b44123dbb9dc7bec178c917d3498cd Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 15 Dec 2020 10:07:30 +0000 Subject: #1000 live: check imageCreate for non-zero return code When running image_create operation an underlying script "imageCreate" is called using the subprocess python module. This script may fail, for example if the repository in which the image is to be stored has no sufficent capacity. Check for non-zero when the imageCreate process has finished. --- src/live/ogOperations.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index b7e6801..6904164 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -240,6 +240,9 @@ class OgLiveOperations: except: raise ValueError('Error: Incorrect command value') + if ogRest.proc.returncode != 0: + raise ValueError('Error: Image creation failed') + with open('/tmp/image.info') as file_info: line = file_info.readline().rstrip() -- cgit v1.2.3-18-g5258