]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Make kernel a separate entity outside of tasks.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 30 Jun 2011 22:53:42 +0000 (15:53 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 30 Jun 2011 23:05:53 +0000 (16:05 -0700)
It is run before anything other than checking for conflicts.
This way it can't step on the connections used by other tasks,
or clobber test files in /tmp when rebooting.

teuthology/run.py
teuthology/task/kernel.py

index 0d90c67d48539d5b8ab90d801c772b0dc67e74f2..ee9e6fd1d84797e5be5f55182e56637f3a942e1f 100644 (file)
@@ -110,13 +110,21 @@ def main():
     if ctx.description is not None:
         ctx.summary['description'] = ctx.description
 
-    ctx.config['tasks'][:0] = [
-        {'internal.check_conflict': None},
-        {'internal.base': None},
-        {'internal.archive': None},
-        {'internal.coredump': None},
-        {'internal.syslog': None},
-        ]
+    for task in ctx.config['tasks']:
+        assert 'kernel' not in task, \
+            'kernel installation shouldn be a base-level item, not part of the tasks list'
+
+    init_tasks = [{'internal.check_conflict': None}]
+    if 'kernel' in ctx.config:
+        init_tasks.append({'kernel': ctx.config['kernel']})
+    init_tasks.extend([
+            {'internal.base': None},
+            {'internal.archive': None},
+            {'internal.coredump': None},
+            {'internal.syslog': None},
+            ])
+
+    ctx.config['tasks'][:0] = init_tasks
 
     from teuthology.run_tasks import run_tasks
     try:
index a6018404b973553ba99581aa21b2dd357949b5c3..27ac2696632acc9ac233042ae27d96498f4614f7 100644 (file)
@@ -109,17 +109,17 @@ def install(ctx, config):
                 'wget',
                 '-nv',
                 '-O',
-                '/tmp/cephtest/linux-image.deb',
-                '--base={url}'.format(url=str(deb_url)),
+                '/tmp/linux-image.deb',
+                '--base={url}'.format(url=deb_url),
                 '--input-file=-',
                 run.Raw('&&'),
                 'sudo',
                 'dpkg',
                 '-i',
-                '/tmp/cephtest/linux-image.deb',
+                '/tmp/linux-image.deb',
                 run.Raw('&&'),
                 'rm',
-                '/tmp/cephtest/linux-image.deb',
+                '/tmp/linux-image.deb',
                 ],
             )
 
@@ -165,42 +165,41 @@ def task(ctx, config):
 
     To install the kernel from the master branch on all hosts::
 
+        kernel:
         tasks:
-        - kernel:
         - ceph:
 
     To wait 5 minutes for hosts to reboot::
 
+        kernel:
+          timeout: 300
         tasks:
-        - kernel:
-            timeout: 300
         - ceph:
 
     To specify different kernels for each client::
 
+        kernel:
+          client.0:
+            branch: foo
+          client.1:
+            tag: v3.0rc1
+          client.2:
+            sha1: db3540522e955c1ebb391f4f5324dff4f20ecd09
         tasks:
-        - kernel:
-            client.0:
-              branch: foo
-            client.1:
-              tag: v3.0rc1
-            client.2:
-              sha1: db3540522e955c1ebb391f4f5324dff4f20ecd09
         - ceph:
 
     You can specify a branch, tag, or sha1 for all roles
     of a certain type (more specific roles override this)::
 
-        tasks:
-        - kernel:
-            client:
-              tag: v3.0
-            osd:
-              branch: btrfs_fixes
-            client.1:
-              branch: more_specific_branch
-            osd.3:
-              branch: master
+        kernel:
+          client:
+            tag: v3.0
+          osd:
+            branch: btrfs_fixes
+          client.1:
+            branch: more_specific_branch
+          osd.3:
+            branch: master
     """
     assert config is None or isinstance(config, dict), \
         "task kernel only supports a dictionary for configuration"