Commit decf86f9 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Make DEFAULT_ENABLED_DISK_TEMPLATES a list



This patch makes the constant DEFAULT_ENABLED_DISK_TEMPLATES
a list instead of a set, because the order of the elements actually matters
as the first one is planned to be the default disk template for instance
creation. Also, this constant is always used like a list and thus providing it
as a set complicates the code that uses it.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 1a0e0593
......@@ -93,7 +93,7 @@ def InitCluster(opts, args):
if enabled_disk_templates:
enabled_disk_templates = enabled_disk_templates.split(",")
else:
enabled_disk_templates = list(constants.DEFAULT_ENABLED_DISK_TEMPLATES)
enabled_disk_templates = constants.DEFAULT_ENABLED_DISK_TEMPLATES
vg_name = None
if opts.vg_name is not None:
......
......@@ -466,10 +466,10 @@ DISK_TEMPLATES = compat.UniqueFrozenset([
])
# disk templates that are enabled by default
DEFAULT_ENABLED_DISK_TEMPLATES = compat.UniqueFrozenset([
DEFAULT_ENABLED_DISK_TEMPLATES = [
DT_DRBD8,
DT_PLAIN,
])
]
# mapping of disk templates to storage types
DISK_TEMPLATES_STORAGE_TYPE = {
......
......@@ -370,7 +370,7 @@ class _QaConfig(object):
"""
return self._GetStringListParameter(
_ENABLED_DISK_TEMPLATES_KEY,
list(constants.DEFAULT_ENABLED_DISK_TEMPLATES))
constants.DEFAULT_ENABLED_DISK_TEMPLATES)
def GetDefaultDiskTemplate(self):
"""Returns the default disk template to be used.
......
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