Commit 8d3f86a0 authored by Iustin Pop's avatar Iustin Pop
Browse files

Change internal API for the IAllocator class



Currently the 'name' parameter in the constructor is required (as a
non-keyword argument). Since the (to follow) node evac IAllocator mode
doesn't have 'name' as a valid argument, we're moving this one into the
per-request key, leaving the constructor required arguments more
abstract.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 9757cc90
......@@ -8495,25 +8495,25 @@ class IAllocator(object):
# pylint: disable-msg=R0902
# lots of instance attributes
_ALLO_KEYS = [
"mem_size", "disks", "disk_template",
"name", "mem_size", "disks", "disk_template",
"os", "tags", "nics", "vcpus", "hypervisor",
]
_RELO_KEYS = [
"relocate_from",
"name", "relocate_from",
]
def __init__(self, cfg, rpc, mode, name, **kwargs):
def __init__(self, cfg, rpc, mode, **kwargs):
self.cfg = cfg
self.rpc = rpc
# init buffer variables
self.in_text = self.out_text = self.in_data = self.out_data = None
# init all input fields so that pylint is happy
self.mode = mode
self.name = name
self.mem_size = self.disks = self.disk_template = None
self.os = self.tags = self.nics = self.vcpus = None
self.hypervisor = None
self.relocate_from = None
self.name = None
# computed fields
self.required_nodes = None
# init result fields
......
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