Comment 2 for bug 1431293

Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote :

Hi James,

Current is_osd_disk() implementation logs a message,

def is_osd_disk(dev):
  ...
    partitions = get_partition_list(dev)
    for partition in partitions:
        try:
            info = str(subprocess
                       .check_output(['sgdisk', '-i', partition.number, dev])
                       .decode('UTF-8'))
            info = info.split("\n") # IGNORE:E1103
            for line in info:
                for ptype in CEPH_PARTITIONS:
                    sig = 'Partition GUID code: {}'.format(ptype)
                    if line.startswith(sig):
                        return True
        except subprocess.CalledProcessError as e:
            log("sgdisk inspection of partition {} on {} failed with " <---
                "error: {}. Skipping".format(partition.minor, dev, e), <---
                level=ERROR)
    return False

Is this adequate for now or would you suggest additional handling of this particular case?