]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: warn for prepare partitions with bad GUIDs 6760/head
authorDavid Disseldorp <ddiss@suse.de>
Wed, 2 Dec 2015 00:46:40 +0000 (01:46 +0100)
committerDavid Disseldorp <ddiss@suse.de>
Wed, 2 Dec 2015 00:46:40 +0000 (01:46 +0100)
If ceph-disk is a given partition device argument for prepare, it leaves
the GPT GUID as is and doesn't check whether the partition's existing
GUID matches the expected value. Print a warning in such cases.

Fixes: #13943
Signed-off-by: David Disseldorp <ddiss@suse.de>
src/ceph-disk

index 7f4a00988f314d3633d55f7fb3b240e6768f5e72..83f85eb4fa0967f59a162a409fb234234a5e2138 100755 (executable)
@@ -1599,6 +1599,11 @@ def prepare_dev(
     if is_partition(data):
         LOG.debug('OSD data device %s is a partition', data)
         rawdev = data
+
+        ptype = get_partition_type(rawdev)
+        if ptype != ptype_osd:
+                LOG.warning('incorrect partition UUID: %s, expected %s'
+                            % (ptype, ptype_osd))
     else:
         LOG.debug('Creating osd partition on %s', data)
         try: