From 331c1640a4377b38d9d0f9dbc711b82a8bddd0b4 Mon Sep 17 00:00:00 2001 From: Tanvi Marballi Date: Thu, 1 Mar 2018 09:22:35 -0800 Subject: [PATCH] Remove the incorrect looping of terminate instances. --- appscale/tools/remote_helper.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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