Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
marrobi committed Nov 14, 2023
1 parent c6a71f7 commit c761590
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions airlock_processor/shared_code/blob_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ def copy_data(source_account_name: str, destination_account_name: str, request_i
udk = source_blob_service_client.get_user_delegation_key(key_start_time=start, key_expiry_time=expiry)

sas_token = generate_container_sas(container_name=container_name,
account_name=source_account_name,
user_delegation_key=udk,
permission=ContainerSasPermissions(read=True),
start=start,
expiry=expiry)

account_name=source_account_name,
user_delegation_key=udk,
permission=ContainerSasPermissions(read=True),
start=start,
expiry=expiry)

source_blob = source_container_client.get_blob_client(blob_name)
source_url = f'{source_blob.url}?{sas_token}'
Expand Down
2 changes: 1 addition & 1 deletion api_app/services/airlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_airlock_request_container_sas_token(account_name: str,
try:
udk = blob_service_client.get_user_delegation_key(key_start_time=start, key_expiry_time=expiry)
except Exception:
raise Exception(f"Failed getting user delegation key, has the API identity been granted 'Storage Blob Data Contributor' access to the storage account {account_name}?")
raise Exception(f"Failed getting user delegation key, has the API identity been granted 'Storage Blob Data Contributor' access to the storage account {account_name}?")

required_permission = get_required_permission(airlock_request)

Expand Down
8 changes: 4 additions & 4 deletions api_app/tests_ma/test_services/test_airlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ async def test_save_and_publish_event_airlock_request_raises_503_if_publish_even

@pytest.mark.asyncio
@pytest.mark.parametrize('role_assignment_details_mock_return', [{},
{"AirlockManager": ["[email protected]"]},
{"WorkspaceResearcher": [], "AirlockManager": ["[email protected]"]},
{"WorkspaceResearcher": ["[email protected]"], "owner_emails": []},
{"WorkspaceResearcher": ["[email protected]"] }])
{"AirlockManager": ["[email protected]"]},
{"WorkspaceResearcher": [], "AirlockManager": ["[email protected]"]},
{"WorkspaceResearcher": ["[email protected]"], "owner_emails": []},
{"WorkspaceResearcher": ["[email protected]"]}])
async def test_check_email_exists_raises_417_if_email_not_present(role_assignment_details_mock_return):
role_assignment_details = role_assignment_details_mock_return
with pytest.raises(HTTPException) as ex:
Expand Down

0 comments on commit c761590

Please sign in to comment.