cmdlib: _VerifyInstancePolicy has been replaced and is dead code
authorRené Nussbaumer <rn@google.com>
Tue, 10 Jan 2012 12:45:03 +0000 (13:45 +0100)
committerRené Nussbaumer <rn@google.com>
Wed, 11 Jan 2012 08:13:57 +0000 (09:13 +0100)
This removes this method

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/cmdlib.py

index 7175e18..d74c97a 100644 (file)
@@ -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.