From 89e8508ea7f947100f4d88300957f0fa0505cd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com> Date: Tue, 10 Jan 2012 13:45:03 +0100 Subject: [PATCH] cmdlib: _VerifyInstancePolicy has been replaced and is dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes this method Signed-off-by: RenΓ© Nussbaumer <rn@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/cmdlib.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 7175e187c..d74c97a3c 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2258,34 +2258,6 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors): msg = "cannot reach the master IP" _ErrorIf(True, constants.CV_ENODENET, node, msg) - def _VerifyInstancePolicy(self, instance): - """Verify instance specs against instance policy set on node group level. - - - """ - cluster = self.cfg.GetClusterInfo() - full_beparams = cluster.FillBE(instance) - ipolicy = cluster.SimpleFillIPolicy(self.group_info.ipolicy) - - mem_size = full_beparams.get(constants.BE_MAXMEM, None) - cpu_count = full_beparams.get(constants.BE_VCPUS, None) - disk_count = len(instance.disks) - disk_sizes = [disk.size for disk in instance.disks] - nic_count = len(instance.nics) - - test_settings = [ - (constants.ISPEC_MEM_SIZE, mem_size), - (constants.ISPEC_CPU_COUNT, cpu_count), - (constants.ISPEC_DISK_COUNT, disk_count), - (constants.ISPEC_NIC_COUNT, nic_count), - ] + map((lambda d: (constants.ISPEC_DISK_SIZE, d)), disk_sizes) - - for (name, value) in test_settings: - test_result = _CheckMinMaxSpecs(name, ipolicy, value) - self._ErrorIf(test_result is not None, - constants.CV_EINSTANCEPOLICY, instance.name, - test_result) - def _VerifyInstance(self, instance, instanceconfig, node_image, diskstatus): """Verify an instance. -- GitLab