Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure blob] fix test_private_bucket for azure blob #3791

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sky/adaptors/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_client(name: str,
if 'ERROR: AADSTS50020' in str(e):
with ux_utils.print_exception_no_traceback():
raise sky_exceptions.StorageBucketGetError(
'Attempted to fetch a non-existant public '
'Attempted to fetch a non-existent public '
'container name: '
f'{container_client.container_name}. '
'Please check if the name is correct.')
Expand Down
2 changes: 1 addition & 1 deletion sky/data/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,7 @@ def _get_bucket(self) -> Tuple[str, bool]:
if 'Name or service not known' in error_message:
with ux_utils.print_exception_no_traceback():
raise exceptions.StorageBucketGetError(
'Attempted to fetch the container from non-existant '
'Attempted to fetch the container from non-existent '
'storage account '
f'name: {self.storage_account_name}. Please check '
'if the name is correct.')
Expand Down
12 changes: 8 additions & 4 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -4895,10 +4895,14 @@ def test_private_bucket(self, private_bucket):
private_bucket).path.strip('/')
else:
private_bucket_name = urllib.parse.urlsplit(private_bucket).netloc
with pytest.raises(
sky.exceptions.StorageBucketGetError,
match=storage_lib._BUCKET_FAIL_TO_CONNECT_MESSAGE.format(
name=private_bucket_name)):
match_str = storage_lib._BUCKET_FAIL_TO_CONNECT_MESSAGE.format(
name=private_bucket_name)
if store_type == 'https':
# Azure blob uses a different error string since container may
# not exist even though the bucket name is ok.
match_str = 'Attempted to fetch a non-existent public container'
with pytest.raises(sky.exceptions.StorageBucketGetError,
match=match_str):
storage_obj = storage_lib.Storage(source=private_bucket)

@pytest.mark.no_fluidstack
Expand Down
Loading