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/19 14:10:27 UTC

[GitHub] Fokko closed pull request #3765: [AIRFLOW-2245] Add remote_host of SSH/SFTP operator as templated field

Fokko closed pull request #3765: [AIRFLOW-2245] Add remote_host of SSH/SFTP operator as templated field
URL: https://github.com/apache/incubator-airflow/pull/3765
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/contrib/operators/sftp_operator.py b/airflow/contrib/operators/sftp_operator.py
index def54c3fba..3c736c8b95 100644
--- a/airflow/contrib/operators/sftp_operator.py
+++ b/airflow/contrib/operators/sftp_operator.py
@@ -37,7 +37,7 @@ class SFTPOperator(BaseOperator):
     :type ssh_hook: :class:`SSHHook`
     :param ssh_conn_id: connection id from airflow Connections
     :type ssh_conn_id: str
-    :param remote_host: remote host to connect
+    :param remote_host: remote host to connect (templated)
     :type remote_host: str
     :param local_filepath: local file path to get or put. (templated)
     :type local_filepath: str
@@ -48,7 +48,7 @@ class SFTPOperator(BaseOperator):
     :param confirm: specify if the SFTP operation should be confirmed, defaults to True
     :type confirm: bool
     """
-    template_fields = ('local_filepath', 'remote_filepath')
+    template_fields = ('local_filepath', 'remote_filepath', 'remote_host')
 
     @apply_defaults
     def __init__(self,
diff --git a/airflow/contrib/operators/ssh_operator.py b/airflow/contrib/operators/ssh_operator.py
index 747ad04ff0..c0e8953d2c 100644
--- a/airflow/contrib/operators/ssh_operator.py
+++ b/airflow/contrib/operators/ssh_operator.py
@@ -35,7 +35,7 @@ class SSHOperator(BaseOperator):
     :type ssh_hook: :class:`SSHHook`
     :param ssh_conn_id: connection id from airflow Connections
     :type ssh_conn_id: str
-    :param remote_host: remote host to connect
+    :param remote_host: remote host to connect (templated)
     :type remote_host: str
     :param command: command to execute on remote host. (templated)
     :type command: str
@@ -45,7 +45,7 @@ class SSHOperator(BaseOperator):
     :type do_xcom_push: bool
     """
 
-    template_fields = ('command',)
+    template_fields = ('command', 'remote_host')
     template_ext = ('.sh',)
 
     @apply_defaults


 

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