]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology command: introduce --interactive-on-error flag
authorDeepika Upadhyay <dupadhya@redhat.com>
Thu, 12 Nov 2020 17:08:41 +0000 (22:38 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Mon, 16 Nov 2020 07:32:59 +0000 (13:02 +0530)
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
docs/detailed_test_config.rst
scripts/run.py
teuthology/run.py

index 50ae910a91f16313655fa732927898d5f59a0228..682f57fe9251ee618bb6e674f0b8a4fcbc462c62 100644 (file)
@@ -239,6 +239,9 @@ chance to inspect the system -- both through Teuthology and via extra
 SSH connections -- and the cleanup completes only when you choose so.
 Just exit the interactive Python session to continue the cleanup.
 
+You can enable interactive-on-error with the ``teuthology`` command option
+``--interactive-on-error``
+
 Interactive task facilities
 ===========================
 
index ea60ff5457659ee732768f5eb0b20ef9c1c17329..20ee6ef3bcb43fbec3dbcbdeb4ab95cd46fe2cc6 100644 (file)
@@ -23,6 +23,10 @@ optional arguments:
   --name NAME                    name for this teuthology run
   --suite-path SUITE_PATH        Location of ceph-qa-suite on disk. If not specified,
                                  it will be fetched
+  --interactive-on-error         drop to a python shell on failure, which will
+                                 halt the job; developer can then ssh to targets
+                                 and examine cluster state.
+
 """
 import docopt
 
index 8bd7bc1900e3c713daf3e4dbfa572b292d2ec2ba..0bae936d653e37e9d445a9df86273b0b708d4310 100644 (file)
@@ -326,6 +326,7 @@ def main(args):
     suite_path = args["--suite-path"]
     os_type = args["--os-type"]
     os_version = args["--os-version"]
+    interactive_on_error = args["--interactive-on-error"]
 
     set_up_logging(verbose, archive)
 
@@ -388,6 +389,9 @@ def main(args):
     if config.get('use_shaman') is not None:
         teuth_config.use_shaman = config['use_shaman']
 
+    #could be refactored for setting and unsetting in hackish way
+    if interactive_on_error:
+       config['interactive-on-error'] = True
     # create a FakeNamespace instance that mimics the old argparse way of doing
     # things we do this so we can pass it to run_tasks without porting those
     # tasks to the new way of doing things right now