You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/07/11 23:58:00 UTC
[jira] [Commented] (AIRFLOW-4136) Fix overwrite of key_file by
constructor in SSHHook
[ https://issues.apache.org/jira/browse/AIRFLOW-4136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883421#comment-16883421 ]
ASF subversion and git services commented on AIRFLOW-4136:
----------------------------------------------------------
Commit d3884493c74a49bea7fc8f825c531baa3f948bec in airflow's branch refs/heads/master from eladkal
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=d388449 ]
[AIRFLOW-4136] fix key_file of hook is overwritten by SSHHook connection (#5558)
Prevent overwrite of key_file by connection if parameter was provided to SSHHook
> Fix overwrite of key_file by constructor in 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
> Fix For: 1.10.4
>
>
> 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.14#76016)