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

objects: Fix off-by-one in error message



For an instance with a single disk the message should be “… disks 0 to
0”, not “… 0 to 1”.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 63fc4229
......@@ -808,7 +808,7 @@ class Instance(TaggableObject):
errors.ECODE_INVAL)
except IndexError:
raise errors.OpPrereqError("Invalid disk index: %d (instace has disks"
" 0 to %d" % (idx, len(self.disks)),
" 0 to %d" % (idx, len(self.disks) - 1),
errors.ECODE_INVAL)
def ToDict(self):
......
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