mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-23 05:35:44 -05:00
ssh: don't fail if a possible key's pubkey file doesn't exist
This commit is contained in:
parent
525c012d9c
commit
2209447af0
1 changed files with 5 additions and 1 deletions
6
ssh.py
6
ssh.py
|
@ -97,5 +97,9 @@ def copy_ssh_keys(root_dir: str, user: str):
|
|||
|
||||
with open(authorized_keys_file, 'a') as authorized_keys:
|
||||
for key in keys:
|
||||
with open(f'{key}.pub', 'r') as file:
|
||||
pub = f'{key}.pub'
|
||||
if not os.path.exists('pub'):
|
||||
logging.debug(f'Skipping key {key}: {pub} not found')
|
||||
continue
|
||||
with open(pub, 'r') as file:
|
||||
authorized_keys.write(file.read())
|
||||
|
|
Loading…
Add table
Reference in a new issue