From 1e713c542800b2fc099f3191a1fbcf1ac1370f49 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 31 Jul 2018 16:46:41 -0400 Subject: [PATCH] ceph-volume util do not use stdin for luminous Signed-off-by: Alfredo Deza (cherry picked from commit e03be24a4ff9b882d4329059fd1f04963d9ba2c5) --- src/ceph-volume/ceph_volume/util/prepare.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index 319964401f768..3ea86ad23bd06 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -7,7 +7,7 @@ the single-call helper import os import logging import json -from ceph_volume import process, conf +from ceph_volume import process, conf, __release__ from ceph_volume.util import system, constants logger = logging.getLogger(__name__) @@ -367,11 +367,22 @@ def osd_mkfs_filestore(osd_id, fsid, keyring): '--mkfs', '-i', osd_id, '--monmap', monmap, - '--keyfile', '-', # goes through stdin + ] + + if __release__ != 'luminous': + # goes through stdin + command.extend(['--keyfile', '-']) + + command.extend([ '--osd-data', path, '--osd-journal', journal, '--osd-uuid', fsid, '--setuser', 'ceph', '--setgroup', 'ceph' - ] - process.call(command, stdin=keyring, terminal_verbose=True, show_command=True) + ]) + + _, _, returncode = process.call( + command, stdin=keyring, terminal_verbose=True, show_command=True + ) + if returncode != 0: + raise RuntimeError('Command failed with exit code %s: %s' % (returncode, ' '.join(command))) -- 2.39.5