Fix hang on unkown host key for network_cli (#32937)

* Don't prompt on force_persistent either

* Propagate persistence setting to lower paramiko connection
This commit is contained in:
Nathaniel Case 2017-11-17 13:09:02 -05:00 committed by GitHub
parent 1a2eb319fe
commit 37d8242e44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -188,7 +188,7 @@ class MyAddPolicy(object):
fingerprint = hexlify(key.get_fingerprint())
ktype = key.get_name()
if C.USE_PERSISTENT_CONNECTIONS:
if C.USE_PERSISTENT_CONNECTIONS or self.connection.force_persistence:
# don't print the prompt string since the user cannot respond
# to the question anyway
raise AnsibleError(AUTHENTICITY_MSG[1:92] % (hostname, ktype, fingerprint))