summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2020-12-15 10:07:30 +0000
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-12-15 12:16:19 +0100
commitbaa03debd7b44123dbb9dc7bec178c917d3498cd (patch)
treed4759fe0653fa263bac04511cf41b7f12394b6c7 /src
parentf0aa3df485172e8419d37186b08cd480f0a2a7d9 (diff)
#1000 live: check imageCreate for non-zero return codev1.2.0
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.
Diffstat (limited to 'src')
-rw-r--r--src/live/ogOperations.py3
1 files changed, 3 insertions, 0 deletions
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()