Skip to content

Commit 2475017

Browse files
committed
mypy
1 parent d4c42cd commit 2475017

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

services/autoscaling/src/simcore_service_autoscaling/modules/cluster_scaling/_auto_scaling_core.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,32 @@ async def _analyze_current_cluster(
9494
docker_nodes: list[Node] = await auto_scaling_mode.get_monitored_nodes(app)
9595

9696
# get the EC2 instances we have
97-
existing_ec2_instances = await get_ec2_client(app).get_instances(
97+
existing_ec2_instances: list[EC2InstanceData] = await get_ec2_client(
98+
app
99+
).get_instances(
98100
key_names=[app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_KEY_NAME],
99101
tags=auto_scaling_mode.get_ec2_tags(app),
100102
state_names=["pending", "running"],
101103
)
102104

103-
terminated_ec2_instances = await get_ec2_client(app).get_instances(
105+
terminated_ec2_instances: list[EC2InstanceData] = await get_ec2_client(
106+
app
107+
).get_instances(
104108
key_names=[app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_KEY_NAME],
105109
tags=auto_scaling_mode.get_ec2_tags(app),
106110
state_names=["terminated"],
107111
)
108112

109-
warm_buffer_ec2_instances = await get_ec2_client(app).get_instances(
113+
warm_buffer_ec2_instances: list[EC2InstanceData] = await get_ec2_client(
114+
app
115+
).get_instances(
110116
key_names=[app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_KEY_NAME],
111117
tags=get_deactivated_warm_buffer_ec2_tags(auto_scaling_mode.get_ec2_tags(app)),
112118
state_names=["stopped"],
113119
)
114120

115-
for instance in itertools.chain(existing_ec2_instances, warm_buffer_ec2_instances):
116-
auto_scaling_mode.add_instance_generic_resources(app, instance)
121+
for i in itertools.chain(existing_ec2_instances, warm_buffer_ec2_instances):
122+
auto_scaling_mode.add_instance_generic_resources(app, i)
117123

118124
attached_ec2s, pending_ec2s = associate_ec2_instances_with_nodes(
119125
docker_nodes, existing_ec2_instances

0 commit comments

Comments
 (0)