]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite/openstack: implement the exit code 795/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 2 Dec 2015 11:05:13 +0000 (12:05 +0100)
committerLoic Dachary <ldachary@redhat.com>
Sat, 27 Feb 2016 05:58:18 +0000 (12:58 +0700)
Make it so the exit code of the command reflects the success or failure
of the suite. This is useful when running with --wait.

Signed-off-by: Loic Dachary <loic@dachary.org>
scripts/openstack.py
scripts/suite.py
teuthology/openstack/__init__.py

index 9b2c7fae4f4572d45ee0175a1ae5e7e0959be8da..43eb1adea375998305fddd4576c0e2f480eef26b 100644 (file)
@@ -3,10 +3,8 @@ import sys
 
 import teuthology.openstack
 
-
 def main(argv=sys.argv[1:]):
-    teuthology.openstack.main(parse_args(argv), argv)
-
+    sys.exit(teuthology.openstack.main(parse_args(argv), argv))
 
 def parse_args(argv):
     parser = argparse.ArgumentParser(
index d6b244cbb17c3d226a3183cb346106e2051af75c..25676a136197d1e5c99bf79420b20627af120c29 100644 (file)
@@ -92,4 +92,4 @@ Scheduler arguments:
 
 def main(argv=sys.argv[1:]):
     args = docopt.docopt(doc, argv=argv)
-    teuthology.suite.main(args)
+    return teuthology.suite.main(args)
index 164a06244e21ac6fe3d71d5d0bf1e74d08bbce1c..2608eb5dab7be6e2455c2fe28088165d83152aac 100644 (file)
@@ -455,10 +455,11 @@ class TeuthologyOpenStack(OpenStack):
         self.key_filename = self.args.key_filename
         self.verify_openstack()
         self.setup()
+        exit_code = 0
         if self.args.suite:
             if self.args.wait:
                 self.reminders()
-            self.run_suite()
+            exit_code = self.run_suite()
             self.reminders()
         if self.args.teardown:
             if self.args.suite and not self.args.wait:
@@ -466,6 +467,7 @@ class TeuthologyOpenStack(OpenStack):
                           " right after a suite is scheduled")
             else:
                 self.teardown()
+        return exit_code
 
     def run_suite(self):
         """
@@ -502,7 +504,7 @@ class TeuthologyOpenStack(OpenStack):
             " --machine-type openstack " +
             " ".join(map(lambda x: "'" + x + "'", argv))
         )
-        self.ssh(command)
+        return self.ssh(command)
 
     def reminders(self):
         if self.args.key_filename: