[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
This commit is contained in:
Richard Baron Penman 2018-01-16 19:25:48 +01:00 коммит произвёл Bolke de Bruin
Родитель f6a1c3cf7f
Коммит 59e3598190
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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':