Skip to content

Commit b457733

Browse files
committed
simplify
1 parent b6e6c72 commit b457733

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

services/autoscaling/src/simcore_service_autoscaling/utils/auto_scaling_core.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import functools
22
import logging
33
import re
4-
from typing import Final
4+
from typing import Final, TypeAlias
55

66
from aws_library.ec2 import (
77
EC2InstanceBootSpecific,
@@ -134,9 +134,7 @@ def ec2_buffer_startup_script(
134134
def _instance_type_by_type_name(
135135
ec2_type: EC2InstanceType, *, type_name: InstanceTypeType | None
136136
) -> bool:
137-
if type_name is None:
138-
return True
139-
return bool(ec2_type.name == type_name)
137+
return type_name is None or ec2_type.name == type_name
140138

141139

142140
def find_selected_instance_type_for_task(
@@ -179,9 +177,9 @@ def get_machine_buffer_type(
179177
return available_ec2_types[0]
180178

181179

182-
DrainedNodes = list[AssociatedInstance]
183-
BufferDrainedNodes = list[AssociatedInstance]
184-
TerminatingNodes = list[AssociatedInstance]
180+
DrainedNodes: TypeAlias = list[AssociatedInstance]
181+
BufferDrainedNodes: TypeAlias = list[AssociatedInstance]
182+
TerminatingNodes: TypeAlias = list[AssociatedInstance]
185183

186184

187185
def sort_drained_nodes(

0 commit comments

Comments
 (0)