Commit a3d32770 authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename OpVerifyCluster and LUVerifyCluster


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent a6682fdc
......@@ -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)
......
......@@ -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.
"""
......
......@@ -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}
......
......@@ -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
......
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment