diff --git a/sky/check.py b/sky/check.py index 84bb19c8da7..67a5b1813d8 100644 --- a/sky/check.py +++ b/sky/check.py @@ -46,6 +46,14 @@ def check_one_cloud(cloud_tuple: Tuple[str, clouds.Cloud]) -> None: for cloud_tuple in sorted(clouds_to_check): check_one_cloud(cloud_tuple) + # Cloudflare is not a real cloud in clouds.CLOUD_REGISTRY, and should not be + # inserted into the DB (otherwise `sky launch` and other code would error + # out when it's trying to look it up in the registry). + enabled_clouds = [ + cloud for cloud in enabled_clouds if not cloud.startswith('Cloudflare') + ] + global_user_state.set_enabled_clouds(enabled_clouds) + if len(enabled_clouds) == 0: click.echo( click.style( @@ -71,14 +79,6 @@ def check_one_cloud(cloud_tuple: Tuple[str, clouds.Cloud]) -> None: rich.print('\n[green]:tada: Enabled clouds :tada:' f'{enabled_clouds_str}[/green]') - # Cloudflare is not a real cloud in clouds.CLOUD_REGISTRY, and should not be - # inserted into the DB (otherwise `sky launch` and other code would error - # out when it's trying to look it up in the registry). - enabled_clouds = [ - cloud for cloud in enabled_clouds if not cloud.startswith('Cloudflare') - ] - global_user_state.set_enabled_clouds(enabled_clouds) - def get_cloud_credential_file_mounts( excluded_clouds: Optional[Iterable[clouds.Cloud]]) -> Dict[str, str]: