Merge "Remove extra space from VPN validator exception messages"

This commit is contained in:
Jenkins
2015-12-10 07:21:54 +00:00
committed by Gerrit Code Review

View File

@@ -35,14 +35,14 @@ def validate_dpd_dict(dpd_dict):
message = _( message = _(
"DPD Dictionary KeyError: " "DPD Dictionary KeyError: "
"Reason-Invalid DPD key : " "Reason-Invalid DPD key : "
"'%(key)s' not in %(supported_key)s ") % { "'%(key)s' not in %(supported_key)s") % {
'key': key, 'supported_key': dpd_supported_keys} 'key': key, 'supported_key': dpd_supported_keys}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
if key == 'action' and value not in dpd_supported_actions: if key == 'action' and value not in dpd_supported_actions:
message = _( message = _(
"DPD Dictionary ValueError: " "DPD Dictionary ValueError: "
"Reason-Invalid DPD action : " "Reason-Invalid DPD action : "
"'%(key_value)s' not in %(supported_action)s ") % { "'%(key_value)s' not in %(supported_action)s") % {
'key_value': value, 'key_value': value,
'supported_action': dpd_supported_actions} 'supported_action': dpd_supported_actions}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
@@ -54,7 +54,7 @@ def validate_dpd_dict(dpd_dict):
message = _( message = _(
"DPD Dictionary ValueError: " "DPD Dictionary ValueError: "
"Reason-Invalid positive integer value: " "Reason-Invalid positive integer value: "
"'%(key)s' = %(value)s ") % { "'%(key)s' = %(value)s") % {
'key': key, 'value': value} 'key': key, 'value': value}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
else: else:
@@ -69,14 +69,14 @@ def validate_lifetime_dict(lifetime_dict):
message = _( message = _(
"Lifetime Dictionary KeyError: " "Lifetime Dictionary KeyError: "
"Reason-Invalid unit key : " "Reason-Invalid unit key : "
"'%(key)s' not in %(supported_key)s ") % { "'%(key)s' not in %(supported_key)s") % {
'key': key, 'supported_key': lifetime_keys} 'key': key, 'supported_key': lifetime_keys}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
if key == 'units' and value not in lifetime_units: if key == 'units' and value not in lifetime_units:
message = _( message = _(
"Lifetime Dictionary ValueError: " "Lifetime Dictionary ValueError: "
"Reason-Invalid units : " "Reason-Invalid units : "
"'%(key_value)s' not in %(supported_units)s ") % { "'%(key_value)s' not in %(supported_units)s") % {
'key_value': key, 'supported_units': lifetime_units} 'key_value': key, 'supported_units': lifetime_units}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
if key == 'value': if key == 'value':
@@ -87,7 +87,7 @@ def validate_lifetime_dict(lifetime_dict):
message = _( message = _(
"Lifetime Dictionary ValueError: " "Lifetime Dictionary ValueError: "
"Reason-Invalid value should be at least 60:" "Reason-Invalid value should be at least 60:"
"'%(key_value)s' = %(value)s ") % { "'%(key_value)s' = %(value)s") % {
'key_value': key, 'value': value} 'key_value': key, 'value': value}
raise exceptions.CommandError(message) raise exceptions.CommandError(message)
else: else: