mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
makes ssh plugin resilient against invalid entries in hosts file
fixes #10238
This commit is contained in:
parent
e349004325
commit
496186f5de
1 changed files with 16 additions and 14 deletions
|
@ -243,6 +243,8 @@ class Connection(ConnectionBase):
|
||||||
tokens = line.split()
|
tokens = line.split()
|
||||||
if not tokens:
|
if not tokens:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if isinstance(tokens, list) and tokens: # skip invalid hostlines
|
||||||
if tokens[0].find(self.HASHED_KEY_MAGIC) == 0:
|
if tokens[0].find(self.HASHED_KEY_MAGIC) == 0:
|
||||||
# this is a hashed known host entry
|
# this is a hashed known host entry
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue