projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63fc422
)
objects: Fix off-by-one in error message
author
Michael Hanselmann
<hansmi@google.com>
Tue, 11 Jan 2011 15:29:51 +0000
(16:29 +0100)
committer
Michael Hanselmann
<hansmi@google.com>
Tue, 11 Jan 2011 15:39:38 +0000
(16:39 +0100)
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
patch
|
blob
|
history
diff --git
a/lib/objects.py
b/lib/objects.py
index
fdda582
..
274c756
100644
(file)
--- 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):