Commit e1ebbfcf authored by Iustin Pop's avatar Iustin Pop
Browse files

Improve error message for wrong opcode parameter values



When given an empty string as value to a parameter that doesn't accept
empty strings, the error message was confusing, since it was showing
just as a double space.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAdeodato Simo <dato@google.com>
parent 2c9fa1ff
......@@ -469,8 +469,8 @@ class BaseOpCode(objectutils.ValidatedSlots):
if set_defaults or hasattr(self, attr_name):
attr_val = getattr(self, attr_name)
if not test(attr_val):
logging.error("OpCode %s, parameter %s, has invalid type %s/value %s"
" expecting type %s",
logging.error("OpCode %s, parameter %s, has invalid type %s/value"
" '%s' expecting type %s",
self.OP_ID, attr_name, type(attr_val), attr_val, test)
raise errors.OpPrereqError("Parameter '%s.%s' fails validation" %
(self.OP_ID, attr_name),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment