Revision 3c049cd3 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
14824 | 14824 |
This checks the opcode parameters depending on the director and mode test. |
14825 | 14825 |
|
14826 | 14826 |
""" |
14827 |
if self.op.mode == constants.IALLOCATOR_MODE_ALLOC: |
|
14827 |
if self.op.mode in (constants.IALLOCATOR_MODE_ALLOC, |
|
14828 |
constants.IALLOCATOR_MODE_MULTI_ALLOC): |
|
14828 | 14829 |
for attr in ["memory", "disks", "disk_template", |
14829 | 14830 |
"os", "tags", "nics", "vcpus"]: |
14830 | 14831 |
if not hasattr(self.op, attr): |
... | ... | |
14896 | 14897 |
elif self.op.mode == constants.IALLOCATOR_MODE_NODE_EVAC: |
14897 | 14898 |
req = iallocator.IAReqNodeEvac(instances=self.op.instances, |
14898 | 14899 |
evac_mode=self.op.evac_mode) |
14900 |
elif self.op.mode == constants.IALLOCATOR_MODE_MULTI_ALLOC: |
|
14901 |
disk_template = self.op.disk_template |
|
14902 |
insts = [iallocator.IAReqInstanceAlloc(name="%s%s" % (self.op.name, idx), |
|
14903 |
memory=self.op.memory, |
|
14904 |
disks=self.op.disks, |
|
14905 |
disk_template=disk_template, |
|
14906 |
os=self.op.os, |
|
14907 |
tags=self.op.tags, |
|
14908 |
nics=self.op.nics, |
|
14909 |
vcpus=self.op.vcpus, |
|
14910 |
spindle_use=self.op.spindle_use, |
|
14911 |
hypervisor=self.op.hypervisor) |
|
14912 |
for idx in range(self.op.count)] |
|
14913 |
req = iallocator.IAReqMultiInstanceAlloc(instances=insts) |
|
14899 | 14914 |
else: |
14900 | 14915 |
raise errors.ProgrammerError("Uncatched mode %s in" |
14901 | 14916 |
" LUTestAllocator.Exec", self.op.mode) |
Also available in: Unified diff