From decf86f90c9a27011105b18860acce1560425332 Mon Sep 17 00:00:00 2001 From: Helga Velroyen <helgav@google.com> Date: Fri, 26 Apr 2013 15:59:33 +0200 Subject: [PATCH] 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: Helga Velroyen <helgav@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/client/gnt_cluster.py | 2 +- lib/constants.py | 4 ++-- qa/qa_config.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index c4141ecda..88a2e196d 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -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: diff --git a/lib/constants.py b/lib/constants.py index e439ea826..2f80c7b16 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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 = { diff --git a/qa/qa_config.py b/qa/qa_config.py index 4e0d5f553..959a347d8 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -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. -- GitLab