diff --git a/airflow/providers/amazon/aws/operators/ecs.py b/airflow/providers/amazon/aws/operators/ecs.py index 0c893176aa53d..0a329df37af12 100644 --- a/airflow/providers/amazon/aws/operators/ecs.py +++ b/airflow/providers/amazon/aws/operators/ecs.py @@ -266,11 +266,11 @@ def _start_task(self): self.arn = response['tasks'][0]['taskArn'] def _try_reattach_task(self): - task_def_resp = self.client.describe_task_definition(self.task_definition) + task_def_resp = self.client.describe_task_definition(taskDefinition=self.task_definition) ecs_task_family = task_def_resp['taskDefinition']['family'] list_tasks_resp = self.client.list_tasks( - cluster=self.cluster, launchType=self.launch_type, desiredStatus='RUNNING', family=ecs_task_family + cluster=self.cluster, desiredStatus='RUNNING', family=ecs_task_family ) running_tasks = list_tasks_resp['taskArns'] diff --git a/tests/providers/amazon/aws/operators/test_ecs.py b/tests/providers/amazon/aws/operators/test_ecs.py index cf4049e49face..9ad19563fd40d 100644 --- a/tests/providers/amazon/aws/operators/test_ecs.py +++ b/tests/providers/amazon/aws/operators/test_ecs.py @@ -340,11 +340,9 @@ def test_reattach_successful(self, launch_type, tags, start_mock, check_mock, wa if tags: extend_args['tags'] = [{'key': k, 'value': v} for (k, v) in tags.items()] - client_mock.describe_task_definition.assert_called_once_with('t') + client_mock.describe_task_definition.assert_called_once_with(taskDefinition='t') - client_mock.list_tasks.assert_called_once_with( - cluster='c', launchType=launch_type, desiredStatus='RUNNING', family='f' - ) + client_mock.list_tasks.assert_called_once_with(cluster='c', desiredStatus='RUNNING', family='f') start_mock.assert_not_called() wait_mock.assert_called_once_with()