diff --git a/sky/benchmark/benchmark_utils.py b/sky/benchmark/benchmark_utils.py index f81abc5b74e..9fd0c529453 100644 --- a/sky/benchmark/benchmark_utils.py +++ b/sky/benchmark/benchmark_utils.py @@ -168,7 +168,7 @@ def _create_benchmark_bucket() -> Tuple[str, str]: bucket_name = f'sky-bench-{uuid.uuid4().hex[:4]}-{getpass.getuser()}' # Select the bucket type. - enabled_clouds = storage_lib.get_enabled_storage_clouds( + enabled_clouds = storage_lib.get_cached_enabled_storage_clouds_or_refresh( raise_if_no_cloud_access=True) # Already checked by raise_if_no_cloud_access=True. assert enabled_clouds diff --git a/sky/data/storage.py b/sky/data/storage.py index 3ca1d7bdeba..2f34d8ee489 100644 --- a/sky/data/storage.py +++ b/sky/data/storage.py @@ -68,12 +68,11 @@ 'It may have been deleted externally.') -def get_enabled_storage_clouds( +def get_cached_enabled_storage_clouds_or_refresh( raise_if_no_cloud_access: bool = False) -> List[str]: # This is a temporary solution until https://github.com/skypilot-org/skypilot/issues/1943 # pylint: disable=line-too-long # is resolved by implementing separate 'enabled_storage_clouds' - enabled_clouds = sky_check.get_cached_enabled_clouds_or_refresh( - raise_if_no_cloud_access=raise_if_no_cloud_access) + enabled_clouds = sky_check.get_cached_enabled_clouds_or_refresh() enabled_clouds = [str(cloud) for cloud in enabled_clouds] enabled_storage_clouds = [ @@ -91,7 +90,7 @@ def get_enabled_storage_clouds( def _is_storage_cloud_enabled(cloud_name: str, try_fix_with_sky_check: bool = True) -> bool: - enabled_storage_clouds = get_enabled_storage_clouds() + enabled_storage_clouds = get_cached_enabled_storage_clouds_or_refresh() if cloud_name in enabled_storage_clouds: return True if try_fix_with_sky_check: diff --git a/sky/task.py b/sky/task.py index ff681dab69f..52bafb7e33d 100644 --- a/sky/task.py +++ b/sky/task.py @@ -871,8 +871,9 @@ def get_preferred_store_type(self) -> storage_lib.StoreType: # assert len(self.resources) == 1, self.resources storage_cloud = None - enabled_storage_clouds = storage_lib.get_enabled_storage_clouds( - raise_if_no_cloud_access=True) + enabled_storage_clouds = ( + storage_lib.get_cached_enabled_storage_clouds_or_refresh( + raise_if_no_cloud_access=True)) if self.best_resources is not None: storage_cloud = self.best_resources.cloud