shubhamraj-git commented on code in PR #73419:
URL: https://github.com/apache/airflow/pull/73419#discussion_r4063053863
##########
providers/ssh/src/airflow/providers/ssh/hooks/ssh.py:
##########
@@ -262,6 +282,12 @@ def __init__(
self.host_key = key_constructor(data=decoded_host_key)
self.no_host_key_check = False
+ # An explicit constructor argument wins over the connection extra and
the default.
+ # Without this there is no way to opt out of host key verification
when the hook is
+ # built directly rather than from a Connection.
+ if constructor_no_host_key_check is not None:
+ self.no_host_key_check = constructor_no_host_key_check
Review Comment:
This conflict check runs against the connection extra before the constructor
override is applied. For a connection containing `host_key` and
`no_host_key_check=true`, explicitly passing `no_host_key_check=False` still
raises here, despite the new documented rule that the constructor wins. Please
compute the effective value before validating it against `host_key`, and cover
this precedence case.
---
Drafted-by: Codex (GPT-5); reviewed by @shubhamraj-git before posting
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]