Skip to content

Commit

Permalink
Merge pull request #6 from Shrobs/remove-cluster-creation
Browse files Browse the repository at this point in the history
removing cluster default creation and removal
  • Loading branch information
Shrobs committed Mar 1, 2017
2 parents 56bc307 + accd41b commit abdb5b4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
6 changes: 0 additions & 6 deletions climulon/handlers/decommission.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,4 @@ def run_decommission(conf, stackSubset):
)
print("Services deleted")

print("Deleting ECS cluster...")
client.delete_cluster(
cluster=configParams["EcsClusterName"]
)
print("ECS cluster deleted")

print("Decommission complete")
7 changes: 0 additions & 7 deletions climulon/handlers/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ def __init__(self, taskDefName):
"family named : %s" % (taskDefName))


class EcsClusterExistsError(BasicException):

def __init__(self, EcsClusterName):
self.message = ("ERROR : There is already an ECS cluster with the name"
" : %s" % (EcsClusterName))


class StackUnresolvedDependency(UnresolvedDependency):

def __init__(self, stackName, missingRefs):
Expand Down
18 changes: 0 additions & 18 deletions climulon/handlers/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ def run_provision(conf, stackSubset, timeout, dry_run):
if value == task:
raise TaskDefExistsError(task)

# Checking if there is an ECS cluster with same name
print("Checking if there is an ECS cluster with current name")
checkClusterResponse = client.describe_clusters(
clusters=[configParams["EcsClusterName"]]
)
if (checkClusterResponse["clusters"] != [] and
checkClusterResponse["clusters"][0]["status"] !=
"INACTIVE"):
raise EcsClusterExistsError(configParams["EcsClusterName"])

print("Checks complete, ready for provisioning")

if dry_run is True:
Expand Down Expand Up @@ -254,14 +244,6 @@ def run_provision(conf, stackSubset, timeout, dry_run):

client = boto3.client('ecs', region_name=template["StackRegion"])

# Create the cluster in ECS
print("Creating cluster : %s" %
(configParams["EcsClusterName"]))
client.create_cluster(
clusterName=configParams["EcsClusterName"])
print("Cluster created : %s" %
(configParams["EcsClusterName"]))

servicesContent = services.fill_service_templates(
servicesContent, configParams)

Expand Down

0 comments on commit abdb5b4

Please sign in to comment.