Fix _validate_valid_values
This commit is contained in:
parent
231b7303f5
commit
26bf588fad
@ -141,17 +141,11 @@ class BaseType:
|
||||
Args:
|
||||
value: The value to validate.
|
||||
"""
|
||||
# FIXME:conf still needed?
|
||||
if not value:
|
||||
return
|
||||
if self.valid_values is not None:
|
||||
if value not in self.valid_values:
|
||||
raise configexc.ValidationError(
|
||||
value,
|
||||
"valid values: {}".format(', '.join(self.valid_values)))
|
||||
else:
|
||||
raise NotImplementedError("{} does not implement validate.".format(
|
||||
self.__class__.__name__))
|
||||
|
||||
def from_str(self, value):
|
||||
"""Get the setting value from a string.
|
||||
|
Loading…
Reference in New Issue
Block a user