Closed
Description
I've had several situations where I want a parser that requires the value to be one of a list of possible values. I'd like to do something like:
from everett.manager import ConfigManager
config = ConfigManager.basic_config()
CLOUD_PROVIDER = config(
"CLOUD_PROVIDER",
default="AWS",
parser=OneOf(["AWS", "GCP"]),
)
and then have that work for "AWS" and "GCP" and raise aValueError
specifying one of the valid values for everything else.
Metadata
Metadata
Assignees
Labels
No labels