]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add function to output a secret key to a file.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 16 Jun 2011 01:06:57 +0000 (18:06 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 16 Jun 2011 01:06:57 +0000 (18:06 -0700)
teuthology/misc.py

index af6942af9accf32eb10ce60e8aae95f900eadf46..d5288eece8e853af7c2cd9c15959ccc12074539f 100644 (file)
@@ -7,6 +7,8 @@ import time
 import urllib2
 import urlparse
 
+from orchestra import run
+
 log = logging.getLogger(__name__)
 
 def get_ceph_binary_url(branch=None, tag=None, sha1=None, flavor=None):
@@ -243,3 +245,17 @@ def wait_until_fuse_mounted(remote, fuse, mountpoint):
 
         time.sleep(5)
     log.info('cfuse is mounted on %s', mountpoint)
+
+def write_secret_file(remote, role, filename):
+    remote.run(
+        args=[
+            '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+            '/tmp/cephtest/archive/coverage',
+            '/tmp/cephtest/binary/usr/local/bin/cauthtool',
+            '--name={role}'.format(role=role),
+            '--print-key',
+            '/tmp/cephtest/data/{role}.keyring'.format(role=role),
+            run.Raw('>'),
+            filename,
+            ],
+        )