Revision e9ed4f2e
b/lib/cmdlib.py | ||
---|---|---|
8511 | 8511 |
if template_name == constants.DT_DISKLESS: |
8512 | 8512 |
pass |
8513 | 8513 |
elif template_name == constants.DT_PLAIN: |
8514 |
if len(secondary_nodes) != 0:
|
|
8514 |
if secondary_nodes:
|
|
8515 | 8515 |
raise errors.ProgrammerError("Wrong template configuration") |
8516 | 8516 |
|
8517 | 8517 |
names = _GenerateUniqueNames(lu, [".disk%d" % (base_index + i) |
... | ... | |
8555 | 8555 |
disk_dev.mode = disk[constants.IDISK_MODE] |
8556 | 8556 |
disks.append(disk_dev) |
8557 | 8557 |
elif template_name == constants.DT_FILE: |
8558 |
if len(secondary_nodes) != 0:
|
|
8558 |
if secondary_nodes:
|
|
8559 | 8559 |
raise errors.ProgrammerError("Wrong template configuration") |
8560 | 8560 |
|
8561 | 8561 |
opcodes.RequireFileStorage() |
... | ... | |
8572 | 8572 |
params=ld_params[0]) |
8573 | 8573 |
disks.append(disk_dev) |
8574 | 8574 |
elif template_name == constants.DT_SHARED_FILE: |
8575 |
if len(secondary_nodes) != 0:
|
|
8575 |
if secondary_nodes:
|
|
8576 | 8576 |
raise errors.ProgrammerError("Wrong template configuration") |
8577 | 8577 |
|
8578 | 8578 |
opcodes.RequireSharedFileStorage() |
... | ... | |
8589 | 8589 |
params=ld_params[0]) |
8590 | 8590 |
disks.append(disk_dev) |
8591 | 8591 |
elif template_name == constants.DT_BLOCK: |
8592 |
if len(secondary_nodes) != 0:
|
|
8592 |
if secondary_nodes:
|
|
8593 | 8593 |
raise errors.ProgrammerError("Wrong template configuration") |
8594 | 8594 |
|
8595 | 8595 |
for idx, disk in enumerate(disk_info): |
Also available in: Unified diff