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/31 21:49:23 UTC

[GitHub] [airflow] eladkal commented on a diff in pull request #27370: SSH task exit code added to XCOM as 'ssh_exit' key

eladkal commented on code in PR #27370:
URL: https://github.com/apache/airflow/pull/27370#discussion_r1009901621


##########
airflow/providers/ssh/operators/ssh.py:
##########
@@ -151,16 +151,18 @@ def exec_ssh_client_command(self, ssh_client: SSHClient, command: str):
             ssh_client, command, timeout=self.timeout, environment=self.environment, get_pty=self.get_pty
         )
 
-    def raise_for_status(self, exit_status: int, stderr: bytes) -> None:
+    def raise_for_status(self, exit_status: int, stderr: bytes, **kwargs) -> None:
+        ti=kwargs["context"].get("task_instance")
+        ti.xcom_push(key="ssh_exit", value=exit_status)

Review Comment:
   I think we should verify user wish to push to xcom.
   users ask for this specifically with `do_xcom_push` parameter



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