use terminateWithIds in terminate

This commit is contained in:
fjy 2014-01-20 16:58:53 -08:00
parent 1d81ad2946
commit ebc66df27d
1 changed files with 5 additions and 22 deletions

View File

@ -155,9 +155,7 @@ public class EC2AutoScalingStrategy implements AutoScalingStrategy
}
try {
log.info("Terminating instances[%s]", instances);
amazonEC2Client.terminateInstances(
new TerminateInstancesRequest(
return terminateWithIds(
Lists.transform(
instances,
new Function<Instance, String>()
@ -169,21 +167,6 @@ public class EC2AutoScalingStrategy implements AutoScalingStrategy
}
}
)
)
);
return new AutoScalingData(
Lists.transform(
ips,
new Function<String, String>()
{
@Override
public String apply(@Nullable String input)
{
return String.format("%s:%s", input, config.getWorkerPort());
}
}
)
);
}
catch (Exception e) {