]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
openstack: fail immediately if VM creation fails
authorNathan Cutler <ncutler@suse.com>
Tue, 23 Oct 2018 11:08:34 +0000 (13:08 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 14 Oct 2019 15:32:08 +0000 (17:32 +0200)
Fixes: https://github.com/SUSE/teuthology/issues/159
Signed-off-by: Nathan Cutler <ncutler@suse.com>
Conflicts:
teuthology/openstack/__init__.py

teuthology/openstack/__init__.py

index 707d8220515d209551e829c5eda30b64e9198a5a..3d7c2ef2a1acd9f388186cf3c3012c9327300e4e 100644 (file)
@@ -82,6 +82,11 @@ class OpenStackInstance(object):
             self.set_info()
         else:
             self.info = dict(map(lambda (k,v): (k.lower(), v), info.items()))
+        if self.info['status'] == 'ERROR':
+            errmsg = 'VM creation failed'
+            if 'message' in self.info:
+                errmsg = '{}: {}'.format(errmsg, self.info['message'])
+            raise Exception(errmsg)
 
     def set_info(self):
         try: