From daa55b04b5b4c976b76fe218b29b5e14dfddf82a Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 11 Jan 2011 16:29:51 +0100 Subject: [PATCH] objects: Fix off-by-one in error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For an instance with a single disk the message should be ββ¦ disks 0 to 0β, not ββ¦ 0 to 1β. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: RenΓ© Nussbaumer <rn@google.com> --- lib/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/objects.py b/lib/objects.py index fdda582fa..274c75641 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -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): -- GitLab