def CheckStorageTypeEnabled(cluster, storage_type):
  assert storage_type is not None
  assert storage_type in constants.STORAGE_TYPES
  # special case for lvm-pv, because it cannot be enabled
  # via disk templates
  if storage_type == constants.ST_LVM_PV:
    CheckStorageTypeEnabled(cluster, constants.ST_LVM_VG)
  else:
    possible_disk_templates = \
        utils.storage.GetDiskTemplatesOfStorageTypes(storage_type)
    for disk_template in possible_disk_templates:
      if disk_template in cluster.enabled_disk_templates:
        return
    raise errors.OpPrereqError("No disk template of storage type '%s' is"
                               " enabled in this cluster. Enabled disk"
                               " templates are: %s" % (storage_type,
                               ",".join(cluster.enabled_disk_templates)))
The string name of the layer.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/common.py/CheckStorageTypeEnabled--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/django/contrib/gis/gdal/layer.py/Layer.__str__