You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/02/23 21:46:51 UTC

[airflow] branch v1-10-stable updated: Fix permission error on non-POSIX filesystem (#13121) (#14383)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v1-10-stable
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v1-10-stable by this push:
     new e8008f5  Fix permission error on non-POSIX filesystem (#13121) (#14383)
e8008f5 is described below

commit e8008f5f67f448c280935320471606d6a6a84a73
Author: cris-b <cr...@beebgames.com>
AuthorDate: Tue Feb 23 21:46:34 2021 +0000

    Fix permission error on non-POSIX filesystem (#13121) (#14383)
    
    * Fix https://github.com/apache/airflow/issues/12669
     - failure to change ownership of log file on azure
---
 airflow/utils/log/file_task_handler.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/airflow/utils/log/file_task_handler.py b/airflow/utils/log/file_task_handler.py
index 16849d1..ef35911 100644
--- a/airflow/utils/log/file_task_handler.py
+++ b/airflow/utils/log/file_task_handler.py
@@ -244,6 +244,9 @@ class FileTaskHandler(logging.Handler):
         if not os.path.exists(full_path):
             open(full_path, "a").close()
             # TODO: Investigate using 444 instead of 666.
-            os.chmod(full_path, 0o666)
+            try:
+                os.chmod(full_path, 0o666)
+            except OSError:
+                logging.warning("OSError while change ownership of the log file")
 
         return full_path