def WarnAndCopyFlag(old_name, new_name):

  if FLAGS[old_name].present:
    logging.warning('Flag --%s is deprecated and will be removed. Please '
                    'switch to --%s.', old_name, new_name)
    if not FLAGS[new_name].present:
      FLAGS[new_name].value = FLAGS[old_name].value

      # Mark the new flag as present so we'll print it out in our list
      # of flag values.
      FLAGS[new_name].present = True
    else:
      logging.warning('Ignoring legacy flag %s because new flag %s is present.',
                      old_name, new_name)
  # We keep the old flag around so that providers that haven't been
  # updated yet will continue to work.
Copy a value from an old flag to a new one, warning the user.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/disk.py/WarnAndCopyFlag