You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2018/01/16 18:25:54 UTC
incubator-airflow git commit: [AIRFLOW-1984] Fix to AWS Batch operator
Repository: incubator-airflow
Updated Branches:
refs/heads/master f6a1c3cf7 -> 59e359819
[AIRFLOW-1984] Fix to AWS Batch operator
Correct key is "container" rather than "attempts":
https://docs.aws.amazon.com/batch/latest/APIRefere
nce/API_DescribeJobs.html
Closes #2927 from richardpenman/master
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/59e35981
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/59e35981
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/59e35981
Branch: refs/heads/master
Commit: 59e35981905c2c1947782d7a0ec508fd9a329fbe
Parents: f6a1c3c
Author: Richard Baron Penman <rp...@coatue.com>
Authored: Tue Jan 16 19:25:48 2018 +0100
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Tue Jan 16 19:25:48 2018 +0100
----------------------------------------------------------------------
airflow/contrib/operators/awsbatch_operator.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/59e35981/airflow/contrib/operators/awsbatch_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/awsbatch_operator.py b/airflow/contrib/operators/awsbatch_operator.py
index 25262dd..d0b022d 100644
--- a/airflow/contrib/operators/awsbatch_operator.py
+++ b/airflow/contrib/operators/awsbatch_operator.py
@@ -143,7 +143,8 @@ class AWSBatchOperator(BaseOperator):
if 'attempts' in job:
containers = job['attempts']
for container in containers:
- if job['status'] == 'FAILED' or container['attempts']['exitCode'] != 0:
+ if (job['status'] == 'FAILED' or
+ container['container']['exitCode'] != 0):
print("@@@@")
raise AirflowException('This containers encounter an error during execution {}'.format(job))
elif job['status'] is not 'SUCCEEDED':