Changeset - 5f4a2f7d9aca
[Not reviewed]
0 1 0
Branko Majic (branko) - 6 years ago 2017-11-19 20:15:57
branko@majic.rs
Noticket: Implement small dummy policy for Paramiko when testing SSH connectivity in common role via Molecule (suppresses a warning about unknown host fingerprint).
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
roles/common/tests/test_parameters_optional.py
Show inline comments
 
@@ -170,8 +170,13 @@ def test_authorized_keys_login():
 
    correctly.
 
    """
 

	
 
    class IgnorePolicy(paramiko.client.MissingHostKeyPolicy):
 

	
 
        def missing_host_key(self, client, hostname, key):
 
            pass
 

	
 
    client = paramiko.client.SSHClient()
 
    client.set_missing_host_key_policy(paramiko.client.WarningPolicy())
 
    client.set_missing_host_key_policy(IgnorePolicy())
 

	
 
    # No exception will be raised if connection is successful.
 
    client.connect("10.31.127.4", username="user2", allow_agent=False, look_for_keys=False, key_filename='tests/data/ssh/clientkey1')
0 comments (0 inline, 0 general)