From d874b57ef2d5cd593a632b6c9b4ab8bf45f80042 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 19 Jul 2013 11:26:58 -0700 Subject: [PATCH] sleep: new task --- teuthology/task/sleep.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 teuthology/task/sleep.py diff --git a/teuthology/task/sleep.py b/teuthology/task/sleep.py new file mode 100644 index 0000000000..363634eaa0 --- /dev/null +++ b/teuthology/task/sleep.py @@ -0,0 +1,29 @@ +import logging +import time + +from teuthology import misc as teuthology +from ..orchestra import run + +log = logging.getLogger(__name__) + +def task(ctx, config): + """ + Sleep for some number of seconds. + + Example:: + + + tasks: + - install: + - ceph: + - sleep: + duration: 10 + - interactive: + + """ + if not config: + config = {} + assert isinstance(config, dict) + duration = int(config.get('duration', 5)) + log.info('Sleeping for %d', duration) + time.sleep(duration) -- 2.39.5