Revision bee581e2
b/lib/cmdlib.py | ||
---|---|---|
12257 | 12257 |
if not hasattr(self.op, "evac_nodes"): |
12258 | 12258 |
raise errors.OpPrereqError("Missing attribute 'evac_nodes' on" |
12259 | 12259 |
" opcode input", errors.ECODE_INVAL) |
12260 |
elif self.op.mode == constants.IALLOCATOR_MODE_MRELOC: |
|
12261 |
if self.op.instances: |
|
12262 |
self.op.instances = _GetWantedInstances(self, self.op.instances) |
|
12263 |
else: |
|
12264 |
raise errors.OpPrereqError("Missing instances to relocate", |
|
12265 |
errors.ECODE_INVAL) |
|
12260 | 12266 |
else: |
12261 | 12267 |
raise errors.OpPrereqError("Invalid test allocator mode '%s'" % |
12262 | 12268 |
self.op.mode, errors.ECODE_INVAL) |
... | ... | |
12296 | 12302 |
ial = IAllocator(self.cfg, self.rpc, |
12297 | 12303 |
mode=self.op.mode, |
12298 | 12304 |
evac_nodes=self.op.evac_nodes) |
12305 |
elif self.op.mode == constants.IALLOCATOR_MODE_MRELOC: |
|
12306 |
ial = IAllocator(self.cfg, self.rpc, |
|
12307 |
mode=self.op.mode, |
|
12308 |
instances=self.op.instances, |
|
12309 |
reloc_mode=self.op.reloc_mode, |
|
12310 |
target_groups=self.op.target_groups) |
|
12299 | 12311 |
else: |
12300 | 12312 |
raise errors.ProgrammerError("Uncatched mode %s in" |
12301 | 12313 |
" LUTestAllocator.Exec", self.op.mode) |
b/lib/opcodes.py | ||
---|---|---|
1430 | 1430 |
("disk_template", None, ht.TMaybeString, None), |
1431 | 1431 |
("evac_nodes", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)), |
1432 | 1432 |
None), |
1433 |
("instances", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)), |
|
1434 |
None), |
|
1435 |
("reloc_mode", None, |
|
1436 |
ht.TOr(ht.TNone, ht.TElemOf(constants.IALLOCATOR_MRELOC_MODES)), None), |
|
1437 |
("target_groups", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)), |
|
1438 |
None), |
|
1433 | 1439 |
] |
1434 | 1440 |
|
1435 | 1441 |
|
Also available in: Unified diff