Commit cd34faf2 authored by Michael Hanselmann's avatar Michael Hanselmann

Make bootstrap._GenerateSelfSignedSslCert public

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 11c31f5c
......@@ -66,7 +66,7 @@ def _InitSSHSetup():
utils.AddAuthorizedKey(auth_keys, utils.ReadFile(pub_key))
def _GenerateSelfSignedSslCert(file_name, validity=(365 * 5)):
def GenerateSelfSignedSslCert(file_name, validity=(365 * 5)):
"""Generates a self-signed SSL certificate.
@type file_name: str
......@@ -107,11 +107,11 @@ def _InitGanetiServerSetup():
the cluster and also generates the SSL certificate.
"""
_GenerateSelfSignedSslCert(constants.SSL_CERT_FILE)
GenerateSelfSignedSslCert(constants.SSL_CERT_FILE)
# Don't overwrite existing file
if not os.path.exists(constants.RAPI_CERT_FILE):
_GenerateSelfSignedSslCert(constants.RAPI_CERT_FILE)
GenerateSelfSignedSslCert(constants.RAPI_CERT_FILE)
if not os.path.exists(constants.HMAC_CLUSTER_KEY):
utils.WriteFile(constants.HMAC_CLUSTER_KEY,
......
......@@ -1211,7 +1211,7 @@ class ConfigWriter:
# Write ssconf files on all nodes (including locally)
if self._last_cluster_serial < self._config_data.cluster.serial_no:
if not self._offline:
result = rpc.RpcRunner.call_write_ssconf_files(\
result = rpc.RpcRunner.call_write_ssconf_files(
self._UnlockedGetNodeList(),
self._UnlockedGetSsconfValues())
for nname, nresu in result.items():
......
......@@ -170,7 +170,7 @@ def main():
if not options.dry_run:
if not os.path.exists(options.RAPI_CERT_FILE):
logging.debug("Writing RAPI certificate to %s", options.RAPI_CERT_FILE)
bootstrap._GenerateSelfSignedSslCert(options.RAPI_CERT_FILE)
bootstrap.GenerateSelfSignedSslCert(options.RAPI_CERT_FILE)
except:
logging.critical("Writing configuration failed. It is probably in an"
......
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