]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: use --keyfile instead of --key
authorSage Weil <sage@redhat.com>
Thu, 30 Nov 2017 14:33:21 +0000 (08:33 -0600)
committerKefu Chai <kchai@redhat.com>
Sun, 3 Dec 2017 02:15:51 +0000 (10:15 +0800)
We do not want the key to show up on the command line (it may appear in
the process list or sudo log file).

Fixes: http://tracker.ceph.com/issues/22283
Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-volume/ceph_volume/util/prepare.py

index 6b38fe0978d536a1705022888ada328d1b241dc1..26fa32f9d104f8b83d90a4a0b66134db7c0c6797 100644 (file)
@@ -205,7 +205,7 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
     ]
 
     if keyring is not None:
-        base_command.extend(['--key', keyring])
+        base_command.extend(['--keyfile', '-'])
 
     if wal:
         base_command.extend(
@@ -221,7 +221,7 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
 
     command = base_command + supplementary_command
 
-    process.run(command, obfuscate='--key')
+    process.call(command, stdin=keyring)
 
 
 def osd_mkfs_filestore(osd_id, fsid):