diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index de5a60dfb3a4adfbd18ae9ed1d7af02651d417fe..f3de68f2d282a233f0bc068437c1d698320e3e53 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 2f248fda3236a07bee8b1f5f242ace383ef1279b..d5e4df3375fa6502661ec3e30640cb439a56d319 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 b8d4bfde9f1b1e51edb6a398150b3d89e3f9d166..277a8f1f970587027f920d71b582b5cb2ef0631b 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 3eb4b83c2c41ca11a2ba0c7fbc41d85616f06fc6..71ba25dc34d6e0a91739fa9cde779d9851f1d51d 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 d39fbb0dab094cd9c1519c1876a855b96355cae4..c96745804bf11e45b9d6838af700a77a14bdea99 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):