malthe commented on a change in pull request #16314:
URL: https://github.com/apache/airflow/pull/16314#discussion_r647388197



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -159,9 +166,15 @@ def __init__(  # pylint: disable=too-many-statements
                     and str(extra_options["look_for_keys"]).lower() == 'false'
                 ):
                     self.look_for_keys = False
-                if "host_key" in extra_options and self.no_host_key_check is 
False:
-                    decoded_host_key = 
decodebytes(extra_options["host_key"].encode('utf-8'))
-                    self.host_key = paramiko.RSAKey(data=decoded_host_key)
+                host_key = extra_options.get("host_key")
+                if host_key is not None and self.no_host_key_check is False:
+                    if host_key.startswith("ssh-"):
+                        key_type, host_key = host_key.split(" ")[:2]
+                        key_constructor = _host_key_mappings[key_type[4:]]

Review comment:
       @uranusjr I have updated to use `None` instead – nice. Also, I have 
added a slightly more intrusive change which that if you specify a `host_key` 
then the system will insist on using that key.
   
   This simplifies the documentation as well.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to