[PATCH master] Verify the node count just if the allocation was successful

0 views
Skip to first unread message

René Nussbaumer

unread,
Sep 26, 2012, 8:54:25 AM9/26/12
to ganeti...@googlegroups.com
---
lib/masterd/iallocator.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/masterd/iallocator.py b/lib/masterd/iallocator.py
index e86097d..71b83d6 100644
--- a/lib/masterd/iallocator.py
+++ b/lib/masterd/iallocator.py
@@ -195,7 +195,7 @@ class IAReqInstanceAlloc(IARequestBase):
"""
IARequestBase.ValidateResult(self, ia, result)

- if len(result) != self.RequiredNodes():
+ if ia.success and len(result) != self.RequiredNodes():
raise errors.ResultValidationError("iallocator returned invalid number"
" of nodes (%s), required %s" %
(len(result), self.RequiredNodes()))
--
1.7.7.3

Michael Hanselmann

unread,
Sep 26, 2012, 8:54:52 AM9/26/12
to René Nussbaumer, ganeti...@googlegroups.com
2012/9/26 René Nussbaumer <r...@google.com>:
> ---
> lib/masterd/iallocator.py | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

LGTM
Reply all
Reply to author
Forward
0 new messages