From a3d3277068494fdc4cfbe23d02e54980d58d4f76 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sat, 15 Jan 2011 12:56:01 +0100
Subject: [PATCH] Rename OpVerifyCluster and LUVerifyCluster
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 lib/client/gnt_cluster.py      |  2 +-
 lib/cmdlib.py                  | 10 +++++-----
 lib/opcodes.py                 |  2 +-
 lib/utils/x509.py              |  2 +-
 test/ganeti.cmdlib_unittest.py |  4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index de5a60dfb..f3de68f2d 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -435,7 +435,7 @@ def VerifyCluster(opts, args):
   skip_checks = []
   if opts.skip_nplusone_mem:
     skip_checks.append(constants.VERIFY_NPLUSONE_MEM)
-  op = opcodes.OpVerifyCluster(skip_checks=skip_checks,
+  op = opcodes.OpClusterVerify(skip_checks=skip_checks,
                                verbose=opts.verbose,
                                error_codes=opts.error_codes,
                                debug_simulate_errors=opts.simulate_errors)
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 2f248fda3..d5e4df337 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1167,7 +1167,7 @@ class LUClusterDestroy(LogicalUnit):
 
 
 def _VerifyCertificate(filename):
-  """Verifies a certificate for LUVerifyCluster.
+  """Verifies a certificate for LUClusterVerify.
 
   @type filename: string
   @param filename: Path to PEM file
@@ -1177,7 +1177,7 @@ def _VerifyCertificate(filename):
     cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
                                            utils.ReadFile(filename))
   except Exception, err: # pylint: disable-msg=W0703
-    return (LUVerifyCluster.ETYPE_ERROR,
+    return (LUClusterVerify.ETYPE_ERROR,
             "Failed to load X509 certificate %s: %s" % (filename, err))
 
   (errcode, msg) = \
@@ -1192,14 +1192,14 @@ def _VerifyCertificate(filename):
   if errcode is None:
     return (None, fnamemsg)
   elif errcode == utils.CERT_WARNING:
-    return (LUVerifyCluster.ETYPE_WARNING, fnamemsg)
+    return (LUClusterVerify.ETYPE_WARNING, fnamemsg)
   elif errcode == utils.CERT_ERROR:
-    return (LUVerifyCluster.ETYPE_ERROR, fnamemsg)
+    return (LUClusterVerify.ETYPE_ERROR, fnamemsg)
 
   raise errors.ProgrammerError("Unhandled certificate error code %r" % errcode)
 
 
-class LUVerifyCluster(LogicalUnit):
+class LUClusterVerify(LogicalUnit):
   """Verifies the cluster status.
 
   """
diff --git a/lib/opcodes.py b/lib/opcodes.py
index b8d4bfde9..277a8f1f9 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -396,7 +396,7 @@ class OpClusterQuery(OpCode):
   OP_ID = "OP_CLUSTER_QUERY"
 
 
-class OpVerifyCluster(OpCode):
+class OpClusterVerify(OpCode):
   """Verify the cluster state.
 
   @type skip_checks: C{list}
diff --git a/lib/utils/x509.py b/lib/utils/x509.py
index 3eb4b83c2..71ba25dc3 100644
--- a/lib/utils/x509.py
+++ b/lib/utils/x509.py
@@ -167,7 +167,7 @@ def _VerifyCertificateInner(expired, not_before, not_after, now,
 
 
 def VerifyX509Certificate(cert, warn_days, error_days):
-  """Verifies a certificate for LUVerifyCluster.
+  """Verifies a certificate for LUClusterVerify.
 
   @type cert: OpenSSL.crypto.X509
   @param cert: X509 certificate object
diff --git a/test/ganeti.cmdlib_unittest.py b/test/ganeti.cmdlib_unittest.py
index d39fbb0da..c96745804 100755
--- a/test/ganeti.cmdlib_unittest.py
+++ b/test/ganeti.cmdlib_unittest.py
@@ -57,12 +57,12 @@ class TestCertVerification(testutils.GanetiTestCase):
     nonexist_filename = os.path.join(self.tmpdir, "does-not-exist")
 
     (errcode, msg) = cmdlib._VerifyCertificate(nonexist_filename)
-    self.assertEqual(errcode, cmdlib.LUVerifyCluster.ETYPE_ERROR)
+    self.assertEqual(errcode, cmdlib.LUClusterVerify.ETYPE_ERROR)
 
     # Try to load non-certificate file
     invalid_cert = self._TestDataFilename("bdev-net.txt")
     (errcode, msg) = cmdlib._VerifyCertificate(invalid_cert)
-    self.assertEqual(errcode, cmdlib.LUVerifyCluster.ETYPE_ERROR)
+    self.assertEqual(errcode, cmdlib.LUClusterVerify.ETYPE_ERROR)
 
 
 class TestOpcodeParams(testutils.GanetiTestCase):
-- 
GitLab