Skip to content
Snippets Groups Projects
Commit 8049a1d7 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Use utils.ReadFile to read SSL certificate

Reviewed-by: iustinp
parent 4c7c81d7
No related branches found
No related tags found
No related merge requests found
......@@ -294,11 +294,7 @@ def SetupNodeDaemon(node, ssh_key_check):
gntpass = utils.GetNodeDaemonPassword()
if not re.match('^[a-zA-Z0-9.]{1,64}$', gntpass):
raise errors.OpExecError("ganeti password corruption detected")
f = open(constants.SSL_CERT_FILE)
try:
gntpem = f.read(8192)
finally:
f.close()
gntpem = utils.ReadFile(constants.SSL_CERT_FILE)
# in the base64 pem encoding, neither '!' nor '.' are valid chars,
# so we use this to detect an invalid certificate; as long as the
# cert doesn't contain this, the here-document will be correctly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment