Merge pull request #2876 from tmwong2003/tmwong2003/ecs-run-task-support-default-cluster

Changed mock_ecs to support ecs.run_task calls with a default cluster
This commit is contained in:
Bert Blommers 2020-04-08 07:53:27 +01:00 committed by GitHub
commit 3b9717d5b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 69 additions and 1 deletions

View file

@ -604,7 +604,10 @@ class EC2ContainerServiceBackend(BaseBackend):
raise Exception("{0} is not a task_definition".format(task_definition_name))
def run_task(self, cluster_str, task_definition_str, count, overrides, started_by):
cluster_name = cluster_str.split("/")[-1]
if cluster_str:
cluster_name = cluster_str.split("/")[-1]
else:
cluster_name = "default"
if cluster_name in self.clusters:
cluster = self.clusters[cluster_name]
else: