From 36daa91c648715859b14487cc09591c53f2b8607 Mon Sep 17 00:00:00 2001 From: Deepika Upadhyay Date: Thu, 12 Nov 2020 22:38:41 +0530 Subject: [PATCH] teuthology command: introduce --interactive-on-error flag Signed-off-by: Deepika Upadhyay --- docs/detailed_test_config.rst | 3 +++ scripts/run.py | 4 ++++ teuthology/run.py | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/docs/detailed_test_config.rst b/docs/detailed_test_config.rst index 50ae910a91..682f57fe92 100644 --- a/docs/detailed_test_config.rst +++ b/docs/detailed_test_config.rst @@ -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 =========================== diff --git a/scripts/run.py b/scripts/run.py index ea60ff5457..20ee6ef3bc 100644 --- a/scripts/run.py +++ b/scripts/run.py @@ -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 diff --git a/teuthology/run.py b/teuthology/run.py index 8bd7bc1900..0bae936d65 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -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 -- 2.39.5