You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/23 23:40:35 UTC

[GitHub] XD-DENG commented on a change in pull request #3793: [AIRFLOW-2948] Arg check & better doc - SSHOperator & SFTPOperator

XD-DENG commented on a change in pull request #3793: [AIRFLOW-2948] Arg check & better doc - SSHOperator & SFTPOperator
URL: https://github.com/apache/incubator-airflow/pull/3793#discussion_r212487852
 
 

 ##########
 File path: airflow/contrib/operators/sftp_operator.py
 ##########
 @@ -77,13 +81,19 @@ def __init__(self,
     def execute(self, context):
         file_msg = None
         try:
-            if self.ssh_conn_id and not self.ssh_hook:
-                self.ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id)
+            if self.ssh_conn_id:
+                if self.ssh_hook:
+                    self.log.info("ssh_conn_id is ignored when ssh_hook is provided.")
+                else:
+                    self.ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id)
 
             if not self.ssh_hook:
 
 Review comment:
   This line is still necessary: what if neither `ssh_conn_id` nor `ssh_hook` is provided?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services