Commit 87e23f2d authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Rename GetEnabledDiskTemplates to include disabled ones



This patch solely renames the functions
_GetEnabledDiskTemplates* to _GetDiskTemplateSets, because
in later patches, we will refactor it to not only output
disk templates that are or get enabled, but also the ones
that get disabled. The list of disabled disk templates
will be used for further sanity checks of operations.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent c2e984e2
......@@ -791,8 +791,8 @@ class LUClusterSetParams(LogicalUnit):
errors.ECODE_ENVIRON)
@staticmethod
def _GetEnabledDiskTemplatesInner(op_enabled_disk_templates,
old_enabled_disk_templates):
def _GetDiskTemplateSetsInner(op_enabled_disk_templates,
old_enabled_disk_templates):
"""Determines the enabled disk templates and the subset of disk templates
that are newly enabled by this operation.
......@@ -808,13 +808,13 @@ class LUClusterSetParams(LogicalUnit):
enabled_disk_templates = old_enabled_disk_templates
return (enabled_disk_templates, new_enabled_disk_templates)
def _GetEnabledDiskTemplates(self, cluster):
def _GetDiskTemplateSets(self, cluster):
"""Determines the enabled disk templates and the subset of disk templates
that are newly enabled by this operation.
"""
return self._GetEnabledDiskTemplatesInner(self.op.enabled_disk_templates,
cluster.enabled_disk_templates)
return self._GetDiskTemplateSetsInner(self.op.enabled_disk_templates,
cluster.enabled_disk_templates)
def _CheckIpolicy(self, cluster, enabled_disk_templates):
"""Checks the ipolicy.
......@@ -946,7 +946,7 @@ class LUClusterSetParams(LogicalUnit):
if node.uuid in node_uuids and node.vm_capable]
(enabled_disk_templates, new_enabled_disk_templates) = \
self._GetEnabledDiskTemplates(cluster)
self._GetDiskTemplateSets(cluster)
self._CheckVgName(vm_capable_node_uuids, enabled_disk_templates,
new_enabled_disk_templates)
......
......@@ -82,7 +82,7 @@ class TestGetEnabledDiskTemplates(unittest.TestCase):
op_dts = [constants.DT_DISKLESS]
old_dts = [constants.DT_DISKLESS]
(enabled_dts, new_dts) =\
cluster.LUClusterSetParams._GetEnabledDiskTemplatesInner(
cluster.LUClusterSetParams._GetDiskTemplateSetsInner(
op_dts, old_dts)
self.assertEqual(enabled_dts, old_dts)
self.assertEqual(new_dts, [])
......
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