Changed mock_ecs to support ecs.run_task calls with a default cluster

This commit is contained in:
Theodore Wong 2020-04-07 15:32:44 -07:00
commit 0163eb6a9d
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: