def _validate_constant(constants, option_value, option_name):
    try:
        constant_value = constants.lookupByValue(option_value)
    except __HOLE__:
        raise UsageError(
            "The option '--{}' got unsupported value: '{}'. "
            "Must be one of: {}.".format(
                option_name, option_value,
                ', '.join(c.value for c in constants.iterconstants())
            )
        )
    return constant_value
dataset/ETHPy150Open ClusterHQ/flocker/admin/installer/_images.py/_validate_constant