Revision a3d32770
b/lib/client/gnt_cluster.py | ||
---|---|---|
435 | 435 |
skip_checks = [] |
436 | 436 |
if opts.skip_nplusone_mem: |
437 | 437 |
skip_checks.append(constants.VERIFY_NPLUSONE_MEM) |
438 |
op = opcodes.OpVerifyCluster(skip_checks=skip_checks,
|
|
438 |
op = opcodes.OpClusterVerify(skip_checks=skip_checks,
|
|
439 | 439 |
verbose=opts.verbose, |
440 | 440 |
error_codes=opts.error_codes, |
441 | 441 |
debug_simulate_errors=opts.simulate_errors) |
b/lib/cmdlib.py | ||
---|---|---|
1167 | 1167 |
|
1168 | 1168 |
|
1169 | 1169 |
def _VerifyCertificate(filename): |
1170 |
"""Verifies a certificate for LUVerifyCluster.
|
|
1170 |
"""Verifies a certificate for LUClusterVerify.
|
|
1171 | 1171 |
|
1172 | 1172 |
@type filename: string |
1173 | 1173 |
@param filename: Path to PEM file |
... | ... | |
1177 | 1177 |
cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, |
1178 | 1178 |
utils.ReadFile(filename)) |
1179 | 1179 |
except Exception, err: # pylint: disable-msg=W0703 |
1180 |
return (LUVerifyCluster.ETYPE_ERROR,
|
|
1180 |
return (LUClusterVerify.ETYPE_ERROR,
|
|
1181 | 1181 |
"Failed to load X509 certificate %s: %s" % (filename, err)) |
1182 | 1182 |
|
1183 | 1183 |
(errcode, msg) = \ |
... | ... | |
1192 | 1192 |
if errcode is None: |
1193 | 1193 |
return (None, fnamemsg) |
1194 | 1194 |
elif errcode == utils.CERT_WARNING: |
1195 |
return (LUVerifyCluster.ETYPE_WARNING, fnamemsg)
|
|
1195 |
return (LUClusterVerify.ETYPE_WARNING, fnamemsg)
|
|
1196 | 1196 |
elif errcode == utils.CERT_ERROR: |
1197 |
return (LUVerifyCluster.ETYPE_ERROR, fnamemsg)
|
|
1197 |
return (LUClusterVerify.ETYPE_ERROR, fnamemsg)
|
|
1198 | 1198 |
|
1199 | 1199 |
raise errors.ProgrammerError("Unhandled certificate error code %r" % errcode) |
1200 | 1200 |
|
1201 | 1201 |
|
1202 |
class LUVerifyCluster(LogicalUnit):
|
|
1202 |
class LUClusterVerify(LogicalUnit):
|
|
1203 | 1203 |
"""Verifies the cluster status. |
1204 | 1204 |
|
1205 | 1205 |
""" |
b/lib/opcodes.py | ||
---|---|---|
396 | 396 |
OP_ID = "OP_CLUSTER_QUERY" |
397 | 397 |
|
398 | 398 |
|
399 |
class OpVerifyCluster(OpCode):
|
|
399 |
class OpClusterVerify(OpCode):
|
|
400 | 400 |
"""Verify the cluster state. |
401 | 401 |
|
402 | 402 |
@type skip_checks: C{list} |
b/lib/utils/x509.py | ||
---|---|---|
167 | 167 |
|
168 | 168 |
|
169 | 169 |
def VerifyX509Certificate(cert, warn_days, error_days): |
170 |
"""Verifies a certificate for LUVerifyCluster.
|
|
170 |
"""Verifies a certificate for LUClusterVerify.
|
|
171 | 171 |
|
172 | 172 |
@type cert: OpenSSL.crypto.X509 |
173 | 173 |
@param cert: X509 certificate object |
b/test/ganeti.cmdlib_unittest.py | ||
---|---|---|
57 | 57 |
nonexist_filename = os.path.join(self.tmpdir, "does-not-exist") |
58 | 58 |
|
59 | 59 |
(errcode, msg) = cmdlib._VerifyCertificate(nonexist_filename) |
60 |
self.assertEqual(errcode, cmdlib.LUVerifyCluster.ETYPE_ERROR)
|
|
60 |
self.assertEqual(errcode, cmdlib.LUClusterVerify.ETYPE_ERROR)
|
|
61 | 61 |
|
62 | 62 |
# Try to load non-certificate file |
63 | 63 |
invalid_cert = self._TestDataFilename("bdev-net.txt") |
64 | 64 |
(errcode, msg) = cmdlib._VerifyCertificate(invalid_cert) |
65 |
self.assertEqual(errcode, cmdlib.LUVerifyCluster.ETYPE_ERROR)
|
|
65 |
self.assertEqual(errcode, cmdlib.LUClusterVerify.ETYPE_ERROR)
|
|
66 | 66 |
|
67 | 67 |
|
68 | 68 |
class TestOpcodeParams(testutils.GanetiTestCase): |
Also available in: Unified diff