plockaby commented on a change in pull request #20114:
URL: https://github.com/apache/airflow/pull/20114#discussion_r764395347



##########
File path: airflow/task/task_runner/base_task_runner.py
##########
@@ -87,11 +86,7 @@ def __init__(self, local_task_job):
 
         self._error_file = NamedTemporaryFile(delete=True)
         if self.run_as_user:
-            try:
-                os.chown(self._error_file.name, 
getpwnam(self.run_as_user).pw_uid, -1)
-            except KeyError:
-                # No user `run_as_user` found
-                pass
+            subprocess.call(['sudo', 'chown', self.run_as_user, 
self._error_file.name], close_fds=True)

Review comment:
       I agree that you're probably right it should be `check_call`. I simply 
stole the the subprocess call that runs a chown a few statements above so maybe 
they should both change?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to