Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

handle error condition when creating a container that is being deleted #582

Merged
2 commits merged into from
Feb 22, 2021
Merged
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
6 changes: 4 additions & 2 deletions src/api-service/__app__/onefuzzlib/azure/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Dict, Optional, Union, cast

from azure.common import AzureHttpError, AzureMissingResourceHttpError
from azure.core.exceptions import ResourceNotFoundError
from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.storage.blob import (
BlobClient,
BlobSasPermissions,
Expand Down Expand Up @@ -123,7 +123,9 @@ def create_container(
client = get_blob_service(account).get_container_client(container)
try:
client.create_container(metadata=metadata)
except AzureHttpError as err:
except (ResourceExistsError, AzureHttpError) as err:
# note: resource exists error happens during creation if the container
# is being deleted
logging.error(
(
"unable to create container. account: %s "
Expand Down