Commit 168c1de2 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Rename SSL_CERT_FILE to NODED_CERT_FILE



To be consistent with RAPI_CERT_FILE, the rather generic named
“SSL_CERT_FILE” constant is renamed to “NODED_CERT_FILE”. The actual file
name is not changed.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 01b6558a
......@@ -401,7 +401,7 @@ def LeaveCluster(modify_ssh_setup):
try:
utils.RemoveFile(constants.HMAC_CLUSTER_KEY)
utils.RemoveFile(constants.RAPI_CERT_FILE)
utils.RemoveFile(constants.SSL_CERT_FILE)
utils.RemoveFile(constants.NODED_CERT_FILE)
except: # pylint: disable-msg=W0702
logging.exception("Error while removing cluster secrets")
......
......@@ -125,15 +125,15 @@ def GenerateClusterCrypto(new_cluster_cert, new_rapi_cert, new_hmac_key,
@param rapi_cert_pem: New RAPI certificate in PEM format
"""
# SSL certificate
cluster_cert_exists = os.path.exists(constants.SSL_CERT_FILE)
# noded SSL certificate
cluster_cert_exists = os.path.exists(constants.NODED_CERT_FILE)
if new_cluster_cert or not cluster_cert_exists:
if cluster_cert_exists:
utils.CreateBackup(constants.SSL_CERT_FILE)
utils.CreateBackup(constants.NODED_CERT_FILE)
logging.debug("Generating new cluster certificate at %s",
constants.SSL_CERT_FILE)
GenerateSelfSignedSslCert(constants.SSL_CERT_FILE)
constants.NODED_CERT_FILE)
GenerateSelfSignedSslCert(constants.NODED_CERT_FILE)
# HMAC key
if new_hmac_key or not os.path.exists(constants.HMAC_CLUSTER_KEY):
......@@ -426,7 +426,7 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check):
"""
sshrunner = ssh.SshRunner(cluster_name)
noded_cert = utils.ReadFile(constants.SSL_CERT_FILE)
noded_cert = utils.ReadFile(constants.NODED_CERT_FILE)
rapi_cert = utils.ReadFile(constants.RAPI_CERT_FILE)
hmac_key = utils.ReadFile(constants.HMAC_CLUSTER_KEY)
......@@ -459,10 +459,10 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check):
"%s!EOF.\n"
"chmod 0400 %s %s %s && "
"%s start %s" %
(constants.SSL_CERT_FILE, noded_cert,
(constants.NODED_CERT_FILE, noded_cert,
constants.RAPI_CERT_FILE, rapi_cert,
constants.HMAC_CLUSTER_KEY, hmac_key,
constants.SSL_CERT_FILE, constants.RAPI_CERT_FILE,
constants.NODED_CERT_FILE, constants.RAPI_CERT_FILE,
constants.HMAC_CLUSTER_KEY,
constants.DAEMON_UTIL, constants.NODED))
......
......@@ -97,7 +97,7 @@ SUB_RUN_DIRS = [ RUN_GANETI_DIR, BDEV_CACHE_DIR, DISK_LINKS_DIR ]
LOCK_DIR = _autoconf.LOCALSTATEDIR + "/lock"
SSCONF_LOCK_FILE = LOCK_DIR + "/ganeti-ssconf.lock"
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
SSL_CERT_FILE = DATA_DIR + "/server.pem"
NODED_CERT_FILE = DATA_DIR + "/server.pem"
RAPI_CERT_FILE = DATA_DIR + "/rapi.pem"
HMAC_CLUSTER_KEY = DATA_DIR + "/hmac.key"
WATCHER_STATEFILE = DATA_DIR + "/watcher.data"
......@@ -114,7 +114,7 @@ SYSCONFDIR = _autoconf.SYSCONFDIR
TOOLSDIR = _autoconf.TOOLSDIR
CONF_DIR = SYSCONFDIR + "/ganeti"
ALL_CERT_FILES = frozenset([SSL_CERT_FILE, RAPI_CERT_FILE])
ALL_CERT_FILES = frozenset([NODED_CERT_FILE, RAPI_CERT_FILE])
MASTER_SOCKET = SOCKET_DIR + "/ganeti-master"
......@@ -129,7 +129,7 @@ MULTITHREADED_DAEMONS = frozenset([MASTERD])
DAEMONS_SSL = {
# daemon-name: (default-cert-path, default-key-path)
NODED: (SSL_CERT_FILE, SSL_CERT_FILE),
NODED: (NODED_CERT_FILE, NODED_CERT_FILE),
RAPI: (RAPI_CERT_FILE, RAPI_CERT_FILE),
}
......
......@@ -185,8 +185,8 @@ class Client:
self.nc = {}
self._ssl_params = \
http.HttpSslParams(ssl_key_path=constants.SSL_CERT_FILE,
ssl_cert_path=constants.SSL_CERT_FILE)
http.HttpSslParams(ssl_key_path=constants.NODED_CERT_FILE,
ssl_cert_path=constants.NODED_CERT_FILE)
def ConnectList(self, node_list, address_list=None):
"""Add a list of nodes to the target nodes.
......
......@@ -554,7 +554,7 @@ def _RenewCrypto(new_cluster_cert, new_rapi_cert, rapi_cert_filename,
files_to_copy = []
if new_cluster_cert:
files_to_copy.append(constants.SSL_CERT_FILE)
files_to_copy.append(constants.NODED_CERT_FILE)
if new_rapi_cert or rapi_cert_pem:
files_to_copy.append(constants.RAPI_CERT_FILE)
......
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