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 2022/10/01 17:50:39 UTC

[GitHub] [airflow] bdsoha opened a new pull request, #26824: Added environment to templated SSHOperator fields

bdsoha opened a new pull request, #26824:
URL: https://github.com/apache/airflow/pull/26824

   Added `environment` as a templated field to the `SSHOperator`.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bdsoha commented on pull request #26824: Added environment to templated SSHOperator fields

Posted by GitBox <gi...@apache.org>.
bdsoha commented on PR #26824:
URL: https://github.com/apache/airflow/pull/26824#issuecomment-1283421302

   @uranusjr It seems like there was a transient failure on one of the tests.
   Can you please re-trigger it?


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bdsoha commented on a diff in pull request #26824: Added environment to templated SSHOperator fields

Posted by GitBox <gi...@apache.org>.
bdsoha commented on code in PR #26824:
URL: https://github.com/apache/airflow/pull/26824#discussion_r998761394


##########
airflow/providers/ssh/operators/ssh.py:
##########
@@ -61,9 +61,12 @@ class SSHOperator(BaseOperator):
     :param banner_timeout: timeout to wait for banner from the server in seconds
     """
 
-    template_fields: Sequence[str] = ('command', 'remote_host')
+    template_fields: Sequence[str] = ('command', 'environment', 'remote_host')
     template_ext: Sequence[str] = ('.sh',)
-    template_fields_renderers = {"command": "bash"}
+    template_fields_renderers = {
+        "command": "bash",
+        "environment": "json",

Review Comment:
   @uranusjr Done, using `python` instead.



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bdsoha commented on a diff in pull request #26824: Added environment to templated SSHOperator fields

Posted by GitBox <gi...@apache.org>.
bdsoha commented on code in PR #26824:
URL: https://github.com/apache/airflow/pull/26824#discussion_r998761394


##########
airflow/providers/ssh/operators/ssh.py:
##########
@@ -61,9 +61,12 @@ class SSHOperator(BaseOperator):
     :param banner_timeout: timeout to wait for banner from the server in seconds
     """
 
-    template_fields: Sequence[str] = ('command', 'remote_host')
+    template_fields: Sequence[str] = ('command', 'environment', 'remote_host')
     template_ext: Sequence[str] = ('.sh',)
-    template_fields_renderers = {"command": "bash"}
+    template_fields_renderers = {
+        "command": "bash",
+        "environment": "json",

Review Comment:
   @uranusjr Done



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr merged pull request #26824: Added environment to templated SSHOperator fields

Posted by GitBox <gi...@apache.org>.
uranusjr merged PR #26824:
URL: https://github.com/apache/airflow/pull/26824


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bdsoha commented on a diff in pull request #26824: Added environment to templated SSHOperator fields

Posted by GitBox <gi...@apache.org>.
bdsoha commented on code in PR #26824:
URL: https://github.com/apache/airflow/pull/26824#discussion_r986706754


##########
airflow/providers/ssh/operators/ssh.py:
##########
@@ -61,9 +61,12 @@ class SSHOperator(BaseOperator):
     :param banner_timeout: timeout to wait for banner from the server in seconds
     """
 
-    template_fields: Sequence[str] = ('command', 'remote_host')
+    template_fields: Sequence[str] = ('command', 'environment', 'remote_host')
     template_ext: Sequence[str] = ('.sh',)
-    template_fields_renderers = {"command": "bash"}
+    template_fields_renderers = {
+        "command": "bash",
+        "environment": "json",

Review Comment:
   @uranusjr The values are later converted into strings *(as all environment variables)*.



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org