You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by fo...@apache.org on 2017/12/28 16:32:32 UTC
incubator-airflow git commit: [AIRFLOW-1955] Do not reference
unassigned variable
Repository: incubator-airflow
Updated Branches:
refs/heads/master 0b70cd843 -> 9565a9879
[AIRFLOW-1955] Do not reference unassigned variable
Closes #2904 from wrp/old_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/9565a987
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/9565a987
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/9565a987
Branch: refs/heads/master
Commit: 9565a9879280d83c6c3987d3a6f8b8933168cedf
Parents: 0b70cd8
Author: William Pursell <wi...@wepay.com>
Authored: Thu Dec 28 17:32:19 2017 +0100
Committer: Fokko Driesprong <fo...@godatadriven.com>
Committed: Thu Dec 28 17:32:19 2017 +0100
----------------------------------------------------------------------
airflow/utils/log/gcs_task_handler.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/9565a987/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 f68165f..3b83c8c 100644
--- a/airflow/utils/log/gcs_task_handler.py
+++ b/airflow/utils/log/gcs_task_handler.py
@@ -138,10 +138,10 @@ class GCSTaskHandler(FileTaskHandler, LoggingMixin):
if append:
try:
old_log = self.gcs_read(remote_log_location)
+ log = '\n'.join([old_log, log]) if old_log else log
except Exception as 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
+ log = '*** Previous log discarded: {}\n\n'.format(str(e)) + log
try:
bkt, blob = self.parse_gcs_url(remote_log_location)