From: Alfredo Deza Date: Thu, 26 Apr 2018 20:26:30 +0000 (-0400) Subject: ceph-volume util.prepare raise on non-zero exit status X-Git-Tag: v13.1.0~43^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18fee5f62a2c68cf7690d5bb5b5c3a6a3974bb23;p=ceph.git ceph-volume util.prepare raise on non-zero exit status Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index 88e8328c02ee6..93b913c3ca3e4 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -322,7 +322,9 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False): command = base_command + supplementary_command - process.call(command, stdin=keyring, show_command=True) + _, _, returncode = process.call(command, stdin=keyring, show_command=True) + if returncode != 0: + raise RuntimeError('Command failed with exit code %s: %s' % (returncode, ' '.join(command))) def osd_mkfs_filestore(osd_id, fsid, keyring): @@ -360,4 +362,8 @@ def osd_mkfs_filestore(osd_id, fsid, keyring): '--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)))