Commit 3517d9b9 authored by Manuel Franceschini's avatar Manuel Franceschini
Browse files

This patch replaces some hardcoded strings with their corresponding constant...

This patch replaces some hardcoded strings with their corresponding constant in `_GenerateDiskTemplate()`.

Reviewed-by: iustinp
parent 0d349b3a
......@@ -2741,9 +2741,9 @@ def _GenerateDiskTemplate(cfg, template_name,
#TODO: compute space requirements
vgname = cfg.GetVGName()
if template_name == "diskless":
if template_name == constants.DT_DISKLESS:
disks = []
elif template_name == "plain":
elif template_name == constants.DT_PLAIN:
if len(secondary_nodes) != 0:
raise errors.ProgrammerError("Wrong template configuration")
......@@ -2755,7 +2755,7 @@ def _GenerateDiskTemplate(cfg, template_name,
logical_id=(vgname, names[1]),
iv_name = "sdb")
disks = [sda_dev, sdb_dev]
elif template_name == "local_raid1":
elif template_name == constants.DT_LOCAL_RAID1:
if len(secondary_nodes) != 0:
raise errors.ProgrammerError("Wrong template configuration")
......
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