summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-10-25 18:14:47 -0700
committerSage Weil <sage@inktank.com>2012-11-12 11:53:10 -0800
commitefac1bb19f1ca3851c7b51d96cb4e82d8d142a45 (patch)
tree12c138d5c20603fba8362e4bdbd163f41f7d51a0
parent39b9da403541617fb088aa4ae03925850aa2de65 (diff)
downloadceph-efac1bb19f1ca3851c7b51d96cb4e82d8d142a45.tar.gz
ceph-disk-prepare: assume parted failure means no partition table
If the disk has no valid label we get an error like Error: /dev/sdi: unrecognised disk label Assume any error we get is that and go with an id label of 1. Signed-off-by: Sage Weil <sage@inktank.com> (cherry picked from commit 8921fc7c7bc28fb98334c06f1f0c10af58085085)
-rwxr-xr-xsrc/ceph-disk-prepare3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ceph-disk-prepare b/src/ceph-disk-prepare
index ec3dd8250f3..66f889aff42 100755
--- a/src/ceph-disk-prepare
+++ b/src/ceph-disk-prepare
@@ -227,7 +227,8 @@ def get_free_partition_index(dev):
],
)
except subprocess.CalledProcessError as e:
- raise PrepareError('cannot read partition index', e)
+ print 'cannot read partition index; assume it isn\'t present\n'
+ return 1
if not lines:
raise PrepareError('parted failed to output anything')