Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASGARD-1011 - Support RDS in VPC #323

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Cleaning up code based on code review feedback
Amadeo Casas committed Jun 12, 2013
commit 3704f0deead2905a347f1304df7cd2eabb5f6105
Original file line number Diff line number Diff line change
@@ -451,28 +451,11 @@ class AutoScalingController {
UserContext userContext = UserContext.of(request)
String name = params.name
AutoScalingGroup group = awsAutoScalingService.getAutoScalingGroup(userContext, name)
Boolean showGroupNext = false
Boolean showTask = false
if (!group) {
flash.message = "Auto Scaling Group '${name}' not found."
} else {
if (group?.instances?.size() <= 0) {
try {
GroupDeleteOperation operation = pushService.startGroupDelete(userContext, group)
showTask = true
redirect(controller: 'task', action: 'show', params: [id: operation.taskId])
} catch (Exception e) {
flash.message = "Could not delete Auto Scaling Group: ${e}"
showGroupNext = true
}
} else {
flash.message = "You cannot delete an auto scaling group that still has instances. " +
"Set the min and max to 0, wait for the instances to disappear, then try deleting again."
showGroupNext = true
}
}
if (!showTask) {
showGroupNext ? redirect(action: 'show', params: [id: name]) : redirect(action: 'list')
GroupDeleteOperation operation = pushService.startGroupDelete(userContext, group)
redirect(controller: 'task', action: 'show', params: [id: operation.taskId])
}
}