airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] feng-tao commented on a change in pull request #3793: [AIRFLOW-2948] Arg check & better doc - SSHOperator & SFTPOperator
Date Thu, 23 Aug 2018 20:14:03 GMT
feng-tao 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_r212441652
 
 

 ##########
 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:
   in this case do we still need this line?

----------------------------------------------------------------
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

Mime
View raw message