From: Sage Weil Date: Fri, 26 Oct 2012 01:14:47 +0000 (-0700) Subject: ceph-disk-prepare: assume parted failure means no partition table X-Git-Tag: v0.54~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8921fc7c7bc28fb98334c06f1f0c10af58085085;p=ceph.git 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 --- diff --git a/src/ceph-disk-prepare b/src/ceph-disk-prepare index ec3dd8250f3c..66f889aff428 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')