[
https://issues.apache.org/jira/browse/AIRFLOW-4136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16830095#comment-16830095
]
ASF GitHub Bot commented on AIRFLOW-4136:
-----------------------------------------
Fokko commented on pull request #5155: [AIRFLOW-4136] Fix overwrite of key_file
by constructor in SSHHook
URL: https://github.com/apache/airflow/pull/5155
----------------------------------------------------------------
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]
> SSHHook
> -------
>
> Key: AIRFLOW-4136
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4136
> Project: Apache Airflow
> Issue Type: Wish
> Components: hooks
> Affects Versions: 1.10.2
> Reporter: Bart Eijk
> Priority: Minor
>
> When instantiating the SSHHook with a ssh_conn_id (with an empty
> 'extra-field) and key_file, the key_file argument is ignored because it is
> overwritten by None in the constructor of the SSHHook.
> Code that is causing this behaviour is in the __init__ method of SSHHook
> (added comments for description of what actually happens)
> {code}
> if conn.extra is not None: # conn.extra is an empty string in
> our case: ''
> extra_options = conn.extra_dejson # returns an empty dict
> self.key_file = extra_options.get("key_file") # sets
> self.key_file to None, overriding user-provided key_file
> {code}
> A fix could either be to check if conn.extra is not None or not '' or to wrap
> the setting of the key_file with:
> {code}
> if "key_file" in extra_options:
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)