

def WarnAndCopyFlag(old_name, new_name):
    'Copy a value from an old flag to a new one, warning the user.\n  '
    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
            FLAGS[new_name].present = True
        else:
            logging.warning('Ignoring legacy flag %s because new flag %s is present.', old_name, new_name)

dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/disk.py WarnAndCopyFlag/original