def _ConvertDiskAndCheckMissingSpindles(self, iobj, instance):
    missing_spindles = False
    if "disks" not in iobj:
      raise Error("Instance '%s' doesn't have a disks entry?!" % instance)
    disks = iobj["disks"]
    if not all(isinstance(d, str) for d in disks):
      #  Disks are not top level citizens
      for idx, dobj in enumerate(disks):
        self.RemovePhysicalId(dobj)

        expected = "disk/%s" % idx
        current = dobj.get("iv_name", "")
        if current != expected:
          logging.warning("Updating iv_name for instance %s/disk %s"
                          " from '%s' to '%s'",
                          instance, idx, current, expected)
          dobj["iv_name"] = expected

        if "dev_type" in dobj:
          self.UpgradeDiskDevType(dobj)

        if not "spindles" in dobj:
          missing_spindles = True

        self.AssignUuid(dobj)
    return missing_spindles
dataset/ETHPy150Open ganeti/ganeti/lib/tools/cfgupgrade.py/CfgUpgrade._ConvertDiskAndCheckMissingSpindles/original