mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Handle ssh key files that may only have a type/key specified
If a specified key did not have a comment, it would be ignored as an invalid key. Fixes #4513
This commit is contained in:
parent
6b60267898
commit
35284818a9
1 changed files with 5 additions and 0 deletions
|
@ -207,6 +207,11 @@ def parsekey(raw_key):
|
||||||
# this line is just 'type key user@host'
|
# this line is just 'type key user@host'
|
||||||
(type,key,comment) = key_parts
|
(type,key,comment) = key_parts
|
||||||
options = None
|
options = None
|
||||||
|
elif len(key_parts) == 2:
|
||||||
|
# assuming just a type/key with no comment
|
||||||
|
(type,key) = key_parts
|
||||||
|
comment = ""
|
||||||
|
options = None
|
||||||
else:
|
else:
|
||||||
# invalid key, maybe a comment?
|
# invalid key, maybe a comment?
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue