Skip to content

Commit 5943922

Browse files
author
Vitaliy Zakaznikov
committed
Adding support for composite server type and location values.
1 parent f7d7e84 commit 5943922

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

testflows/github/hetzner/runners/scale_up.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,10 @@ def get_server_types(labels: set[str], default: ServerType, label_prefix: str =
272272
for label in labels:
273273
label = label.lower()
274274
if label.startswith(label_prefix):
275-
server_type_name = label.split(label_prefix, 1)[-1].lower()
276-
server_type = ServerType(name=server_type_name)
277-
server_types.append(server_type)
275+
server_type_names = label.split(label_prefix, 1)[-1].lower().split("-")
276+
for server_type_name in server_type_names:
277+
server_type = ServerType(name=server_type_name)
278+
server_types.append(server_type)
278279

279280
if not server_types:
280281
server_types = [default]
@@ -300,9 +301,10 @@ def get_server_locations(
300301
for label in labels:
301302
label = label.lower()
302303
if label.startswith(label_prefix):
303-
server_location_name = label.split(label_prefix, 1)[-1].lower()
304-
server_location = Location(name=server_location_name)
305-
server_locations.append(server_location)
304+
server_location_names = label.split(label_prefix, 1)[-1].lower().split("-")
305+
for server_location_name in server_location_names:
306+
server_location = Location(name=server_location_name)
307+
server_locations.append(server_location)
306308

307309
if not server_locations:
308310
server_locations = [default]

0 commit comments

Comments
 (0)