From 16a715e3966e7708146fb6c73b0f4f11c3100e4e Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Tue, 23 Jan 2024 21:44:50 +0000 Subject: [PATCH 1/2] Fix empty status for Azure --- sky/clouds/azure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sky/clouds/azure.py b/sky/clouds/azure.py index c9797767b70..a60b04904ba 100644 --- a/sky/clouds/azure.py +++ b/sky/clouds/azure.py @@ -651,6 +651,8 @@ def query_status(cls, name: str, tag_filters: Dict[str, str], assert stdout.strip(), f'No status returned for {name!r}' original_statuses_list = json.loads(stdout.strip()) + if not original_statuses_list: + return [] if not isinstance(original_statuses_list, list): original_statuses_list = [original_statuses_list] statuses = [] From 4bee6f988a8bfb9f2efb89d25c04dc397c7e1ef5 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Tue, 23 Jan 2024 21:45:39 +0000 Subject: [PATCH 2/2] Add comment --- sky/clouds/azure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sky/clouds/azure.py b/sky/clouds/azure.py index a60b04904ba..d8eabd3803a 100644 --- a/sky/clouds/azure.py +++ b/sky/clouds/azure.py @@ -652,6 +652,8 @@ def query_status(cls, name: str, tag_filters: Dict[str, str], original_statuses_list = json.loads(stdout.strip()) if not original_statuses_list: + # No nodes found. The original_statuses_list will be empty string. + # Return empty list. return [] if not isinstance(original_statuses_list, list): original_statuses_list = [original_statuses_list]