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

prepare-node-join: Use ssh.GetAllUserFiles


Instead of building the dictionary locally, the global version in
“ssh.py” can be used.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 5484cda5
No related branches found
No related tags found
No related merge requests found
...@@ -282,17 +282,11 @@ def UpdateSshRoot(data, dry_run, _homedir_fn=None): ...@@ -282,17 +282,11 @@ def UpdateSshRoot(data, dry_run, _homedir_fn=None):
if not keys: if not keys:
return return
(dsa_private_file, dsa_public_file, auth_keys_file) = \ (auth_keys_file, keyfiles) = \
ssh.GetUserFiles(constants.SSH_LOGIN_USER, mkdir=True, ssh.GetAllUserFiles(constants.SSH_LOGIN_USER, mkdir=True,
kind=constants.SSHK_DSA, _homedir_fn=_homedir_fn) _homedir_fn=_homedir_fn)
(rsa_private_file, rsa_public_file, _) = \
ssh.GetUserFiles(constants.SSH_LOGIN_USER, mkdir=True, _UpdateKeyFiles(keys, dry_run, keyfiles)
kind=constants.SSHK_RSA, _homedir_fn=_homedir_fn)
_UpdateKeyFiles(keys, dry_run, {
constants.SSHK_RSA: (rsa_private_file, rsa_public_file),
constants.SSHK_DSA: (dsa_private_file, dsa_public_file),
})
if dry_run: if dry_run:
logging.info("This is a dry run, not modifying %s", auth_keys_file) logging.info("This is a dry run, not modifying %s", auth_keys_file)
......
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