airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-1869] Do not emit spurious warning on missing logs
Date Fri, 08 Dec 2017 09:17:52 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 4936a8077 -> 75eef96af


[AIRFLOW-1869] Do not emit spurious warning on missing logs

If the log does not already exist then we are not
discarding it, and
this message is more confusing than helpful.

Closes #2856 from wrp/suppress-log


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/75eef96a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/75eef96a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/75eef96a

Branch: refs/heads/master
Commit: 75eef96af6d6a91ae90e65498c6ee9377853e37e
Parents: 4936a80
Author: William Pursell <williamp@wepay.com>
Authored: Fri Dec 8 10:17:42 2017 +0100
Committer: Bolke de Bruin <bolke@xs4all.nl>
Committed: Fri Dec 8 10:17:42 2017 +0100

----------------------------------------------------------------------
 airflow/utils/log/gcs_task_handler.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/75eef96a/airflow/utils/log/gcs_task_handler.py
----------------------------------------------------------------------
diff --git a/airflow/utils/log/gcs_task_handler.py b/airflow/utils/log/gcs_task_handler.py
index fea5acc..a87d1d4 100644
--- a/airflow/utils/log/gcs_task_handler.py
+++ b/airflow/utils/log/gcs_task_handler.py
@@ -134,7 +134,8 @@ class GCSTaskHandler(FileTaskHandler, LoggingMixin):
             try:
                 old_log = self.gcs_read(remote_log_location)
             except Exception as e:
-                old_log = '*** Previous log discarded: {}\n\n'.format(str(e))
+                if not hasattr(e, 'resp') or e.resp.get('status') != '404':
+                    old_log = '*** Previous log discarded: {}\n\n'.format(str(e))
             log = '\n'.join([old_log, log]) if old_log else log
 
         try:


Mime
View raw message