def WarnAndTranslateDiskTypes(name, cloud):
  """Translate old disk types to new disk types, printing warnings if needed.

  Args:
    name: a string specifying a disk type, either new or old.
    cloud: the cloud we're running on.

  Returns:
    The new-style disk type name (i.e. the provider's name for the type).
  """

  if cloud in DISK_TYPE_MAPS:
    disk_type_map = DISK_TYPE_MAPS[cloud]
    if name in disk_type_map and disk_type_map[name] != name:
      new_name = disk_type_map[name]
      logging.warning('Disk type name %s is deprecated and will be removed. '
                      'Translating to %s for now.', name, new_name)
      return new_name
    else:
      return name
  else:
    logging.info('No legacy->new disk type map for provider %s', cloud)
    # The provider has not been updated to use new-style names. We
    # need to keep benchmarks working, so we pass through the name.
    return name
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/disk.py/WarnAndTranslateDiskTypes/original