]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ceph: copy cluster log file to archive/ceph.log
authorSage Weil <sage@newdream.net>
Tue, 23 Aug 2011 05:04:57 +0000 (22:04 -0700)
committerSage Weil <sage@newdream.net>
Tue, 23 Aug 2011 05:04:57 +0000 (22:04 -0700)
teuthology/task/ceph.py

index 5c41b300360f46ab694884c7a6a50d4d3adcf411..91f51676876dec85262d469485b903e3a01af1ac 100644 (file)
@@ -509,6 +509,19 @@ def cluster(ctx, config):
     try:
         yield
     finally:
+        if ctx.archive is not None:
+            (remote,) = ctx.cluster.only(firstmon).remotes.iterkeys()
+            log.info('Grabbing cluster log from %s %s...' % (remote, firstmon))
+            dest = os.path.join(ctx.archive, 'ceph.log')
+            proc = remote.run(
+                args = [
+                    'cat',
+                    '--',
+                    '/tmp/cephtest/data/%s/log' % firstmon
+                    ],
+                stdout=file(dest, 'wb'),
+                )
+
         log.info('Cleaning ceph cluster...')
         run.wait(
             ctx.cluster.run(