]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
moving client.keyring creation out of ceph task
authortamil <tamil.muthamizhan@inktank.com>
Thu, 21 Mar 2013 23:14:54 +0000 (16:14 -0700)
committertamil <tamil.muthamizhan@inktank.com>
Thu, 21 Mar 2013 23:14:54 +0000 (16:14 -0700)
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
teuthology/task/ceph.py
teuthology/task/ceph_client.py [new file with mode: 0644]

index db0f929595f4f761f39650afd6b6176ad93f3055..fbaff38d4e2e39b47496304f6d14f0a73d2e15ed 100644 (file)
@@ -9,6 +9,7 @@ import sys
 from teuthology import misc as teuthology
 from teuthology import contextutil
 from ..orchestra import run
+import ceph_client as cclient
 
 log = logging.getLogger(__name__)
 
@@ -506,31 +507,7 @@ def cluster(ctx, config):
                     ],
                 )
 
-    log.info('Setting up client nodes...')
-    clients = ctx.cluster.only(teuthology.is_type('client'))
-    for remote, roles_for_host in clients.remotes.iteritems():
-        for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
-            client_keyring = '/etc/ceph/ceph.client.{id}.keyring'.format(id=id_)
-            remote.run(
-                args=[
-                    '{tdir}/enable-coredump'.format(tdir=testdir),
-                    'ceph-coverage',
-                    coverage_dir,
-                    'sudo',
-                    'ceph-authtool',
-                    '--create-keyring',
-                    '--gen-key',
-                    # TODO this --name= is not really obeyed, all unknown "types" are munged to "client"
-                    '--name=client.{id}'.format(id=id_),
-                    client_keyring,
-                    run.Raw('&&'),
-                    'sudo',
-                    'chmod',
-                    '0644',
-                    client_keyring,
-                    ],
-                )
-
+    cclient.create_keyring(ctx)
     log.info('Running mkfs on osd nodes...')
     for remote, roles_for_host in osds.remotes.iteritems():
         roles_to_devs = remote_to_roles_to_devs[remote]
diff --git a/teuthology/task/ceph_client.py b/teuthology/task/ceph_client.py
new file mode 100644 (file)
index 0000000..7418500
--- /dev/null
@@ -0,0 +1,37 @@
+import argparse
+import contextlib
+import logging
+
+from teuthology import misc as teuthology
+from teuthology import contextutil
+from ..orchestra import run
+
+log = logging.getLogger(__name__)
+
+def create_keyring(ctx):
+    log.info('Setting up client nodes...')
+    clients = ctx.cluster.only(teuthology.is_type('client'))
+    testdir = teuthology.get_testdir(ctx)
+    coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir)
+    for remote, roles_for_host in clients.remotes.iteritems():
+        for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
+            client_keyring = '/etc/ceph/ceph.client.{id}.keyring'.format(id=id_)
+            remote.run(
+                args=[
+                    '{tdir}/enable-coredump'.format(tdir=testdir),
+                    'ceph-coverage',
+                    coverage_dir,
+                    'sudo',
+                    'ceph-authtool',
+                    '--create-keyring',
+                    '--gen-key',
+                    # TODO this --name= is not really obeyed, all unknown "types" are munged to "client"
+                    '--name=client.{id}'.format(id=id_),
+                    client_keyring,
+                    run.Raw('&&'),
+                    'sudo',
+                    'chmod',
+                    '0644',
+                    client_keyring,
+                    ],
+                )