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 2019/05/06 16:28:10 UTC

[GitHub] [airflow] eepstein commented on a change in pull request #5135: pass remote_host via constructor if defined

eepstein commented on a change in pull request #5135: pass remote_host via constructor if defined
URL: https://github.com/apache/airflow/pull/5135#discussion_r281258645
 
 

 ##########
 File path: airflow/contrib/operators/ssh_operator.py
 ##########
 @@ -71,11 +71,19 @@ def execute(self, context):
             if self.ssh_conn_id:
                 if self.ssh_hook and isinstance(self.ssh_hook, SSHHook):
                     self.log.info("ssh_conn_id is ignored when ssh_hook is provided.")
+                    
+                if self.remote_host is not None:
+                    self.ssh_hook.remote_host = self.remote_host
+
                 else:
                     self.log.info("ssh_hook is not provided or invalid. " +
                                   "Trying ssh_conn_id to create SSHHook.")
-                    self.ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id,
-                                            timeout=self.timeout)
+                    if self.remote_host is not None:
 
 Review comment:
   good point.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services