]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.prepare raise on non-zero exit status
authorAlfredo Deza <adeza@redhat.com>
Thu, 26 Apr 2018 20:26:30 +0000 (16:26 -0400)
committerAlfredo Deza <adeza@redhat.com>
Thu, 26 Apr 2018 20:26:30 +0000 (16:26 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/prepare.py

index 88e8328c02ee691aaa8c6da8fbd2be66bf12ffbd..93b913c3ca3e4653357a641ce8488bbf966adced 100644 (file)
@@ -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)))