From bf4b252c66d83c21de19715a3b891ad86d9e1a65 Mon Sep 17 00:00:00 2001 From: Romil Bhardwaj Date: Thu, 16 May 2024 22:49:53 -0700 Subject: [PATCH] comments --- sky/check.py | 10 +++++----- sky/utils/schemas.py | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sky/check.py b/sky/check.py index 64cde9a31f1..a5af7a5beb2 100644 --- a/sky/check.py +++ b/sky/check.py @@ -75,17 +75,17 @@ def get_all_clouds(): # Use allowed_clouds from config if it exists, otherwise check all clouds. # Also validate names with get_cloud_tuple. - config_allowed_clouds = [ + config_allowed_cloud_names = [ get_cloud_tuple(c)[0] for c in skypilot_config.get_nested( ['allowed_clouds'], get_all_clouds()) ] # Use skipped_clouds for logging the skipped clouds. skipped_clouds = [ - c for c in clouds_to_check if c[0] not in config_allowed_clouds + c for c in clouds_to_check if c[0] not in config_allowed_cloud_names ] # Check only the clouds which are allowed in the config. clouds_to_check = [ - c for c in clouds_to_check if c[0] in config_allowed_clouds + c for c in clouds_to_check if c[0] in config_allowed_cloud_names ] for cloud_tuple in sorted(clouds_to_check): @@ -101,7 +101,7 @@ def get_all_clouds(): cloud for cloud in disabled_clouds if not cloud.startswith('Cloudflare') } config_allowed_clouds_set = { - cloud for cloud in config_allowed_clouds + cloud for cloud in config_allowed_cloud_names if not cloud.startswith('Cloudflare') } previously_enabled_clouds_set = { @@ -121,7 +121,7 @@ def get_all_clouds(): skipped_clouds_hint = None if skipped_clouds: skipped_clouds_hint = ( - '\nNote: The following clouds were skipped because they were not ' + '\nNote: The following clouds were disabled because they were not ' 'included in allowed_clouds in ~/.sky/config.yaml: ' f'{", ".join([c[0] for c in skipped_clouds])}') if len(all_enabled_clouds) == 0: diff --git a/sky/utils/schemas.py b/sky/utils/schemas.py index 82d7cba58fc..a23ef66434b 100644 --- a/sky/utils/schemas.py +++ b/sky/utils/schemas.py @@ -588,6 +588,7 @@ def get_default_remote_identity(cloud: str) -> str: def get_config_schema(): # pylint: disable=import-outside-toplevel from sky.utils import kubernetes_enums + from sky.clouds import service_catalog resources_schema = { k: v @@ -727,6 +728,8 @@ def get_config_schema(): 'type': 'array', 'items': { 'type': 'string', + 'case_insensitive_enum': (list(service_catalog.ALL_CLOUDS) + + ['cloudflare']) } }