From 1415ecbd7de21ed2ab0c8f6e20f707cbe4f1390c Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Mon, 21 Aug 2017 14:06:13 +1000 Subject: [PATCH] ceph-disk: Use stdin for 'config-key put' command The 'osd new' command is not available in jewel so backport support for stdin '-i -' and use it for the 'config-key put' command in order to not log the dmcrypt key. Fixes: http://tracker.ceph.com/issues/21059 Signed-off-by: Brad Hubbard --- src/ceph-disk/ceph_disk/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 94ec8bf184bf0..a40c33476e4f1 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -2362,17 +2362,18 @@ def create_key(self): cluster = self.args.cluster bootstrap = self.args.prepare_key_template.format(cluster=cluster, statedir=STATEDIR) - command_check_call( + command_with_stdin( [ 'ceph', '--cluster', cluster, '--name', 'client.bootstrap-osd', '--keyring', bootstrap, + '-i', '-', 'config-key', 'put', 'dm-crypt/osd/' + self.args.osd_uuid + '/luks', - base64_key, ], + base64_key ) keyring, stderr, ret = command( [