From 03e05930116f02d623cf1cefd498b8b833692d09 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 4 May 2015 09:38:18 -0700 Subject: [PATCH] task: add full_sequential --- teuthology/task/full_sequential.py | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 teuthology/task/full_sequential.py diff --git a/teuthology/task/full_sequential.py b/teuthology/task/full_sequential.py new file mode 100644 index 0000000000..197a554968 --- /dev/null +++ b/teuthology/task/full_sequential.py @@ -0,0 +1,39 @@ +""" +Task sequencer - full +""" +import sys +import logging + +from teuthology import run_tasks + +log = logging.getLogger(__name__) + + +def task(ctx, config): + """ + Run a set of tasks to completion in order. __exit__ is called on a task + before __enter__ on the next + + example: + - full_sequential: + - tasktest: + - tasktest: + + :param ctx: Context + :param config: Configuration + """ + for entry in config: + if not isinstance(entry, dict): + entry = ctx.config.get(entry, {}) + ((taskname, confg),) = entry.iteritems() + log.info('In full_sequential, running task %s...' % taskname) + mgr = run_tasks.run_one_task(taskname, ctx=ctx, config=confg) + if hasattr(mgr, '__enter__'): + try: + mgr.__enter__() + finally: + try: + exc_info = sys.exc_info() + mgr.__exit__(*exc_info) + finally: + del exc_info -- 2.39.5