forked from Mirror/pmbootstrap
install: Do not fail on invalid SSH key
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2576
This commit is contained in:
parent
e9038e50d6
commit
a80b27d0bd
1 changed files with 7 additions and 1 deletions
|
@ -308,7 +308,13 @@ def copy_ssh_keys(config: Config) -> None:
|
|||
keys = []
|
||||
for key in glob.glob(os.path.expanduser(config.ssh_key_glob)):
|
||||
with open(key) as infile:
|
||||
keys += infile.readlines()
|
||||
try:
|
||||
keys += infile.readlines()
|
||||
except UnicodeDecodeError:
|
||||
logging.info(
|
||||
f"WARNING: {key} is not a valid SSH key. "
|
||||
"This file will not be copied to device."
|
||||
)
|
||||
|
||||
if not len(keys):
|
||||
logging.info(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue