#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.
more_events v1.2.0
Jose M. Guisado 2020-12-15 10:07:30 +00:00 committed by OpenGnSys Support Team
parent f0aa3df485
commit baa03debd7
1 changed files with 3 additions and 0 deletions

View File

@ -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()