Skip to content

Commit 686cc89

Browse files
committed
continue from except
1 parent 716214a commit 686cc89

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

sky/check.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,15 @@ def check_one_cloud(
8282
cloud_repr, cloud = cloud_tuple
8383
assert capabilities is not None
8484
for capability in capabilities:
85-
not_supported = False
8685
with rich_utils.safe_status(f'Checking {cloud_repr}...'):
8786
try:
8887
ok, reason = check_credentials(cloud, capability)
8988
except exceptions.NotSupportedError:
90-
not_supported = True
89+
continue
9190
except Exception: # pylint: disable=broad-except
9291
# Catch all exceptions to prevent a single cloud
9392
# from blocking the check for other clouds.
9493
ok, reason = False, traceback.format_exc()
95-
if not_supported:
96-
continue
9794
status_msg = ('enabled' if ok else 'disabled')
9895
styles = {'fg': 'green', 'bold': False} if ok else {'dim': True}
9996
echo(' ' + click.style(f'{cloud_repr}: {status_msg}', **styles) +
@@ -287,8 +284,8 @@ def get_cached_enabled_storage_clouds_or_refresh(
287284
exceptions.NoCloudAccessError: if no public cloud is enabled and
288285
raise_if_no_cloud_access is set to True.
289286
"""
290-
cached_enabled_storage_clouds = \
291-
global_user_state.get_cached_enabled_storage_clouds()
287+
cached_enabled_storage_clouds = (
288+
global_user_state.get_cached_enabled_storage_clouds())
292289
if not cached_enabled_storage_clouds:
293290
try:
294291
check(quiet=True, capability=CloudCapability.STORAGE)
@@ -297,8 +294,8 @@ def get_cached_enabled_storage_clouds_or_refresh(
297294
# Here we catch it and raise the exception later only if
298295
# raise_if_no_cloud_access is set to True.
299296
pass
300-
cached_enabled_storage_clouds = \
301-
global_user_state.get_cached_enabled_storage_clouds()
297+
cached_enabled_storage_clouds = (
298+
global_user_state.get_cached_enabled_storage_clouds())
302299
if raise_if_no_cloud_access and not cached_enabled_storage_clouds:
303300
with ux_utils.print_exception_no_traceback():
304301
raise exceptions.NoCloudAccessError(

0 commit comments

Comments
 (0)