def WarnAndTranslateDiskTypes(name, cloud):

  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
Post a twitter status message from the authenticated user.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/disk.py/WarnAndTranslateDiskTypes--crossover with--dataset/ETHPy150Open livid/v2ex/twitter/twitter.py/Api.PostUpdate