Catch the right error when the constraint type name is not set;

This commit is contained in:
Benjamin Bouvier 2017-06-13 16:02:31 +02:00
parent 2d30061b7b
commit 8c126ef8e3

View File

@ -95,6 +95,7 @@ def validate_config(config):
# message in the log output. # message in the log output.
# pylint: disable=locally-disabled,line-too-long # pylint: disable=locally-disabled,line-too-long
assert "type" in config["constraints"] assert "type" in config["constraints"]
assert isinstance(config["constraints"]["type"], (str, unicode))
assert config["constraints"]["type"].upper() in ["RENT", assert config["constraints"]["type"].upper() in ["RENT",
"SALE", "SHARING"] "SALE", "SHARING"]