Commit 7e1fac25 authored by Michael Hanselmann's avatar Michael Hanselmann

Use “daemon-util” to reload SSH keys

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 88df4f39
......@@ -408,7 +408,6 @@ lib/_autoconf.py: Makefile stamp-directories
echo "VERSION_FULL = '$(VERSION_FULL)'"; \
echo "LOCALSTATEDIR = '$(localstatedir)'"; \
echo "SYSCONFDIR = '$(sysconfdir)'"; \
echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
......@@ -437,6 +436,7 @@ $(REPLACE_VARS_SED): Makefile
echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
} > $@
......
......@@ -104,6 +104,11 @@ stop_master() {
stop ganeti-masterd
}
# Reloads the SSH keys
reload_ssh_keys() {
@RPL_SSH_INITD_SCRIPT@ restart
}
if [[ "$#" -lt 1 ]]; then
echo "Usage: $0 <action>" >&2
exit 1
......
......@@ -355,7 +355,10 @@ def AddNode(dsa, dsapub, rsa, rsapub, sshkey, sshpub):
utils.AddAuthorizedKey(auth_keys, sshpub)
utils.RunCmd([constants.SSH_INITD_SCRIPT, "restart"])
result = utils.RunCmd([constants.DAEMON_UTIL, "reload-ssh-keys"])
if result.failed:
_Fail("Unable to reload SSH keys (command %r, exit code %s, output %r)",
result.cmd, result.exit_code, result.output)
def LeaveCluster(modify_ssh_setup):
......
......@@ -338,7 +338,6 @@ OS_API_FILE = 'ganeti_api_version'
OS_VARIANTS_FILE = 'variants.list'
# ssh constants
SSH_INITD_SCRIPT = _autoconf.SSH_INITD_SCRIPT
SSH_CONFIG_DIR = "/etc/ssh/"
SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "ssh_host_dsa_key"
SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
......
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