Fix the error message when reached max number of traits
The error message is not properly tranlated as desired, raw string is returned when reached maximum number of traits. Change-Id: I62b2d32c545b6ad6487aead98c8fab212ed5e83f
This commit is contained in:
@@ -1520,12 +1520,12 @@ class Connection(api.Connection):
|
|||||||
per-node trait limit.
|
per-node trait limit.
|
||||||
"""
|
"""
|
||||||
if num_traits > MAX_TRAITS_PER_NODE:
|
if num_traits > MAX_TRAITS_PER_NODE:
|
||||||
msg = _("Could not modify traits for node %(node_id)s as it would "
|
msg = (_("Could not modify traits for node %(node_id)s as it "
|
||||||
"exceed the maximum number of traits per node "
|
"would exceed the maximum number of traits per node "
|
||||||
"(%(num_traits)d vs. %(max_traits)d)")
|
"(%(num_traits)d vs. %(max_traits)d)")
|
||||||
raise exception.InvalidParameterValue(
|
% {'node_id': node_id, 'num_traits': num_traits,
|
||||||
msg, node_id=node_id, num_traits=num_traits,
|
'max_traits': MAX_TRAITS_PER_NODE})
|
||||||
max_traits=MAX_TRAITS_PER_NODE)
|
raise exception.InvalidParameterValue(err=msg)
|
||||||
|
|
||||||
@oslo_db_api.retry_on_deadlock
|
@oslo_db_api.retry_on_deadlock
|
||||||
def set_node_traits(self, node_id, traits, version):
|
def set_node_traits(self, node_id, traits, version):
|
||||||
|
Reference in New Issue
Block a user