Revision 823a72bc lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
8861 | 8861 |
fname = _ExpandInstanceName(self.cfg, self.op.name) |
8862 | 8862 |
self.op.name = fname |
8863 | 8863 |
self.relocate_from = self.cfg.GetInstanceInfo(fname).secondary_nodes |
8864 |
elif self.op.mode == constants.IALLOCATOR_MODE_MEVAC: |
|
8865 |
if not hasattr(self.op, "evac_nodes"): |
|
8866 |
raise errors.OpPrereqError("Missing attribute 'evac_nodes' on" |
|
8867 |
" opcode input", errors.ECODE_INVAL) |
|
8864 | 8868 |
else: |
8865 | 8869 |
raise errors.OpPrereqError("Invalid test allocator mode '%s'" % |
8866 | 8870 |
self.op.mode, errors.ECODE_INVAL) |
... | ... | |
8890 | 8894 |
vcpus=self.op.vcpus, |
8891 | 8895 |
hypervisor=self.op.hypervisor, |
8892 | 8896 |
) |
8893 |
else:
|
|
8897 |
elif self.op.mode == constants.IALLOCATOR_MODE_RELOC:
|
|
8894 | 8898 |
ial = IAllocator(self.cfg, self.rpc, |
8895 | 8899 |
mode=self.op.mode, |
8896 | 8900 |
name=self.op.name, |
8897 | 8901 |
relocate_from=list(self.relocate_from), |
8898 | 8902 |
) |
8903 |
elif self.op.mode == constants.IALLOCATOR_MODE_MEVAC: |
|
8904 |
ial = IAllocator(self.cfg, self.rpc, |
|
8905 |
mode=self.op.mode, |
|
8906 |
evac_nodes=self.op.evac_nodes) |
|
8907 |
else: |
|
8908 |
raise errors.ProgrammerError("Uncatched mode %s in" |
|
8909 |
" LUTestAllocator.Exec", self.op.mode) |
|
8899 | 8910 |
|
8900 | 8911 |
if self.op.direction == constants.IALLOCATOR_DIR_IN: |
8901 | 8912 |
result = ial.in_text |
Also available in: Unified diff