diff --git a/appscale/tools/remote_helper.py b/appscale/tools/remote_helper.py index 26044418..06654068 100644 --- a/appscale/tools/remote_helper.py +++ b/appscale/tools/remote_helper.py @@ -900,12 +900,11 @@ def terminate_spawned_instances(cls, spawned_instance_ids, agent, params): """ terminate_params = params.copy() terminate_params[agent.PARAM_INSTANCE_IDS] = spawned_instance_ids - for _ in range(len(spawned_instance_ids)): - try: - agent.terminate_instances(params) - except (AgentRuntimeException, BotoServerError): - AppScaleLogger.warn("AppScale failed to terminate instance(s) with " - "id(s): {}".format(spawned_instance_ids)) + try: + agent.terminate_instances(terminate_params) + except (AgentRuntimeException, BotoServerError): + AppScaleLogger.warn("AppScale failed to terminate instance(s) with " + "id(s): {}".format(spawned_instance_ids)) @classmethod