|
@@ -36,16 +36,12 @@ DOCKER_CONFIG_HINTS = {
|
|
|
VALID_NAME_CHARS = '[a-zA-Z0-9\._\-]'
|
|
|
|
|
|
|
|
|
[email protected]_checks(
|
|
|
- format="ports",
|
|
|
- raises=ValidationError(
|
|
|
- "Invalid port formatting, it should be "
|
|
|
- "'[[remote_ip:]remote_port:]port[/protocol]'"))
|
|
|
[email protected]_checks(format="ports", raises=ValidationError)
|
|
|
def format_ports(instance):
|
|
|
try:
|
|
|
split_port(instance)
|
|
|
- except ValueError:
|
|
|
- return False
|
|
|
+ except ValueError as e:
|
|
|
+ raise ValidationError(six.text_type(e))
|
|
|
return True
|
|
|
|
|
|
|
|
@@ -184,6 +180,10 @@ def handle_generic_service_error(error, service_name):
|
|
|
config_key,
|
|
|
required_keys)
|
|
|
|
|
|
+ elif error.cause:
|
|
|
+ error_msg = six.text_type(error.cause)
|
|
|
+ msg_format = "Service '{}' configuration key {} is invalid: {}"
|
|
|
+
|
|
|
elif error.path:
|
|
|
msg_format = "Service '{}' configuration key {} value {}"
|
|
|
|