dmvieira closed pull request #2748: Fixing temp path
URL: https://github.com/apache/incubator-airflow/pull/2748
 
 
   

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/operators/bash_operator.py 
b/airflow/operators/bash_operator.py
index a7eeb03ad6..d29aaee96b 100644
--- a/airflow/operators/bash_operator.py
+++ b/airflow/operators/bash_operator.py
@@ -73,8 +73,7 @@ def execute(self, context):
 
                 f.write(bytes(bash_command, 'utf_8'))
                 f.flush()
-                fname = f.name
-                script_location = tmp_dir + "/" + fname
+                script_location = f.name
                 self.log.info(
                     "Temporary script location: %s",
                     script_location
@@ -87,7 +86,7 @@ def pre_exec():
                     os.setsid()
                 self.log.info("Running command: %s", bash_command)
                 sp = Popen(
-                    ['bash', fname],
+                    ['bash', script_location],
                     stdout=PIPE, stderr=STDOUT,
                     cwd=tmp_dir, env=self.env,
                     preexec_fn=pre_exec)


 

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


With regards,
Apache Git Services

Reply via email to