Verify the node count just if the allocation was successful
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix REQ_RESULT for MultiInstanceAllocRequest
Fix a validation issue
We want to validate the result only if the iallocation run was asuccess.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Migrate lib/masterd/instance.py from constants to pathutils
File system paths moved from constants to pathutils.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Small style adjustment
Make iallocator request types more strict
This adapts the type of some request input fields to more stricter ones.
Rework the required_nodes field
This was used to verify the result of instance allocation. However, thisis not logic which belongs to the cmdlib rather than to the iallocatorrequest itself. So abstract it by its own function. And update theValidateResult accordingly....
Disable pylint warnings for unknown members
For some reason pylint can't determine, that the members are calculatedupon runtime and complains. This is weird as the same mechanism works onopcode/objects. I haven't found the issue for it yet, so let's just...
Adding new multi-allocation request
Now that we've the refactoring done, we can easily add the new mode andeverything works.
Refactor IAllocator code
The IAllocator class was handling all the requests on its own, passingin parameters on top level which works, but is hard to maintain and notflexible.
With the upcoming change to the IAllocator for MultiAllocate we can'tuse the toplevel parameters anymore. Therefore, we refactor the code...
View revisions
Also available in: Atom