Commit a81075bf authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cmdlib._CheckInstanceState: Use instance name in error message



The variable “instance” is an instance object, so to not get a
serialized version of the instance, the “name” attribute must be
used.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e53ea88d
......@@ -1039,8 +1039,8 @@ def _CheckInstanceState(lu, instance, req_states, msg=None):
if msg is None:
msg = "can't use instance from outside %s states" % ", ".join(req_states)
if instance.admin_state not in req_states:
raise errors.OpPrereqError("Instance %s is marked to be %s, %s" %
(instance, instance.admin_state, msg),
raise errors.OpPrereqError("Instance '%s' is marked to be %s, %s" %
(instance.name, instance.admin_state, msg),
errors.ECODE_STATE)
 
if constants.ADMINST_UP not in req_states:
......
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