Skip to content

Commit 7a5cdbd

Browse files
Edwinhr716changlan
authored andcommitted
fix for list command
1 parent 8cf9057 commit 7a5cdbd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

axlearn/cloud/gcp/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,11 @@ def list_k8s_leaderworkerset(*, namespace: str) -> list[str]:
422422
propagation_policy="Foreground",
423423
**custom_leaderworkerset_kwargs(),
424424
)
425-
426-
return [lws.metadata.name for lws in lws_groups.items]
425+
names = []
426+
for lws in lws_groups["items"]:
427+
if name := lws.get("metadata", {}).get("name", ""):
428+
names.append(name)
429+
return names
427430

428431

429432
def custom_leaderworkerset_kwargs() -> dict[str, str]:

0 commit comments

Comments
 (0)