From: Josh Durgin Date: Thu, 16 Jun 2011 01:06:57 +0000 (-0700) Subject: Add function to output a secret key to a file. X-Git-Tag: v0.94.10~27^2^2~364^2~1729 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d70d04893168f79692324fe56d81f42e42a675c;p=ceph.git Add function to output a secret key to a file. --- diff --git a/teuthology/misc.py b/teuthology/misc.py index af6942af9accf..d5288eece8e85 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -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, + ], + )