Merge pull request #2474 from jrstarke/2473

Added Exception to describe_container_instances to match aws api
This commit is contained in:
Mike Grima 2019-10-12 15:41:02 -07:00 committed by GitHub
commit c46ee4cf8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -790,6 +790,8 @@ class EC2ContainerServiceBackend(BaseBackend):
cluster_name = cluster_str.split('/')[-1]
if cluster_name not in self.clusters:
raise Exception("{0} is not a cluster".format(cluster_name))
if not list_container_instance_ids:
raise JsonRESTError('InvalidParameterException', 'Container instance cannot be empty')
failures = []
container_instance_objects = []
for container_instance_id in list_container_instance_ids:

View File

@ -889,6 +889,12 @@ def test_describe_container_instances():
instance.keys().should.contain('runningTasksCount')
instance.keys().should.contain('pendingTasksCount')
with assert_raises(ClientError) as e:
ecs_client.describe_container_instances(
cluster=test_cluster_name,
containerInstances=[]
)
@mock_ec2
@mock_ecs