]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
sleep: new task
authorSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 18:26:58 +0000 (11:26 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 18:26:58 +0000 (11:26 -0700)
teuthology/task/sleep.py [new file with mode: 0644]

diff --git a/teuthology/task/sleep.py b/teuthology/task/sleep.py
new file mode 100644 (file)
index 0000000..363634e
--- /dev/null
@@ -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)