Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
romilbhardwaj committed May 17, 2024
1 parent fd44999 commit bf4b252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sky/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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 = {
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions sky/utils/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -727,6 +728,8 @@ def get_config_schema():
'type': 'array',
'items': {
'type': 'string',
'case_insensitive_enum': (list(service_catalog.ALL_CLOUDS) +
['cloudflare'])
}
}

Expand Down

0 comments on commit bf4b252

Please sign in to comment.