Commit e231fc44 authored by Michal Čihař's avatar Michal Čihař

Fix migration of ssh files

Fixes #611
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent edf1259a
......@@ -62,8 +62,12 @@ def migrate_data_dirs(*args, **kwargs):
ssh_home = os.path.expanduser('~/.ssh')
ssh = data_dir('ssh')
if os.path.exists(ssh_home) and not os.path.exists(ssh):
shutil.copytree(ssh_home, ssh)
for name in ('known_hosts', 'id_rsa', 'id_rsa.pub'):
source = os.path.join(ssh_home, name)
target = os.path.join(ssh, name)
if os.path.exists(source) and not os.path.exists(target):
shutil.copy(source, target)
def unmigrate_data_dirs(*args, **kwargs):
......
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