From 6180d6bbcf00dd0135a40ad42317139ffdeb7552 Mon Sep 17 00:00:00 2001
From: Dmitry Chernyak <dmi.chernyak@gmail.com>
Date: Thu, 25 Nov 2010 03:14:39 +0300
Subject: [PATCH] Removed _CheckNodesFreeDisk function

Was substituted by _CheckNodesFreeDiskPerVG.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cmdlib.py | 36 ------------------------------------
 1 file changed, 36 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 47a542a0d..7cc79431b 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -4767,42 +4767,6 @@ def _CheckNodesFreeDiskOnVG(lu, nodenames, vg, requested):
                                  errors.ECODE_NORES)
 
 
-def _CheckNodesFreeDisk(lu, nodenames, requested):
-  """Checks if nodes have enough free disk space in the default VG.
-
-  This function check if all given nodes have the needed amount of
-  free disk. In case any node has less disk or we cannot get the
-  information from the node, this function raise an OpPrereqError
-  exception.
-
-  @type lu: C{LogicalUnit}
-  @param lu: a logical unit from which we get configuration data
-  @type nodenames: C{list}
-  @param nodenames: the list of node names to check
-  @type requested: C{int}
-  @param requested: the amount of disk in MiB to check for
-  @raise errors.OpPrereqError: if the node doesn't have enough disk, or
-      we cannot check the node
-
-  """
-  nodeinfo = lu.rpc.call_node_info(nodenames, lu.cfg.GetVGName(),
-                                   lu.cfg.GetHypervisorType())
-  for node in nodenames:
-    info = nodeinfo[node]
-    info.Raise("Cannot get current information from node %s" % node,
-               prereq=True, ecode=errors.ECODE_ENVIRON)
-    vg_free = info.payload.get("vg_free", None)
-    if not isinstance(vg_free, int):
-      raise errors.OpPrereqError("Can't compute free disk space on node %s,"
-                                 " result was '%s'" % (node, vg_free),
-                                 errors.ECODE_ENVIRON)
-    if requested > vg_free:
-      raise errors.OpPrereqError("Not enough disk space on target node %s:"
-                                 " required %d MiB, available %d MiB" %
-                                 (node, requested, vg_free),
-                                 errors.ECODE_NORES)
-
-
 class LUStartupInstance(LogicalUnit):
   """Starts an instance.
 
-- 
GitLab