Skip to content

Commit

Permalink
fixing storage account extraction in AzureACL
Browse files Browse the repository at this point in the history
  • Loading branch information
HariGS-DB committed Mar 30, 2024
1 parent be7e757 commit 4abe7af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/databricks/labs/ucx/hive_metastore/grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,13 @@ def _get_external_locations(
if location.url is None:
continue

Check warning on line 409 in src/databricks/labs/ucx/hive_metastore/grants.py

View check run for this annotation

Codecov / codecov/patch

src/databricks/labs/ucx/hive_metastore/grants.py#L409

Added line #L409 was not covered by tests
for permission_mapping in permission_mappings:
prefix = permission_mapping.prefix
if (
location.url.startswith(permission_mapping.prefix)
and permission_mapping.client_id == spn.application_id
and spn.storage_account is not None
and spn.storage_account in permission_mapping.prefix
# check for storage account name starting after @ in the prefix url
and prefix[prefix.index('@') + 1 :].startswith(spn.storage_account)
):
matching_location[location.url] = permission_mapping.privilege
return matching_location
Expand Down

0 comments on commit 4abe7af

Please sign in to comment.