def AllDiskOfType(disks_info, dev_types):
  """Checks if the instance has only disks of any of the dev_types.

  @type disks_info: list of L{Disk}
  @param disks_info: all the disks of the instance.
  @type dev_types: list of disk templates
  @param dev_types: the disk type required.

  @rtype: bool
  @return: True iff the instance only has disks of type dev_type.
  """

  assert not isinstance(dev_types, str)

  if not disks_info and constants.DT_DISKLESS not in dev_types:
    return False

  for disk in disks_info:
    if disk.dev_type not in dev_types:
      return False

  return True
dataset/ETHPy150Open ganeti/ganeti/lib/utils/__init__.py/AllDiskOfType/original