containerio 2.2.0__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {containerio-2.2.0 → containerio-2.2.1}/PKG-INFO +1 -1
- {containerio-2.2.0 → containerio-2.2.1}/pyproject.toml +1 -1
- {containerio-2.2.0 → containerio-2.2.1}/src/containerio/handler.py +10 -6
- {containerio-2.2.0 → containerio-2.2.1}/README.md +0 -0
- {containerio-2.2.0 → containerio-2.2.1}/src/containerio/__init__.py +0 -0
- {containerio-2.2.0 → containerio-2.2.1}/src/containerio/azure_config.py +0 -0
- {containerio-2.2.0 → containerio-2.2.1}/src/containerio/session.py +0 -0
- {containerio-2.2.0 → containerio-2.2.1}/src/containerio/tools/cli.py +0 -0
|
@@ -1049,18 +1049,22 @@ class StorageHandler:
|
|
|
1049
1049
|
prefix = blob_name.rstrip("/") + "/"
|
|
1050
1050
|
children = list(self.container_client.list_blobs(name_starts_with=prefix))
|
|
1051
1051
|
|
|
1052
|
-
#
|
|
1052
|
+
# Delete children deepest-first. On hierarchical-namespace
|
|
1053
|
+
# (ADLS Gen2) accounts a directory placeholder cannot be
|
|
1054
|
+
# removed until empty, and a parent path always sorts before
|
|
1055
|
+
# its descendants, so reverse order empties each placeholder
|
|
1056
|
+
# before deleting it. Flat namespaces are order-independent.
|
|
1057
|
+
for blob in sorted(children, key=lambda child: child.name, reverse=True):
|
|
1058
|
+
self._get_blob_client(blob_name=blob.name).delete_blob()
|
|
1059
|
+
deleted.append(blob.name)
|
|
1060
|
+
|
|
1061
|
+
# Delete the exact blob (file or now-empty dir) last.
|
|
1053
1062
|
try:
|
|
1054
1063
|
self._get_blob_client(blob_name=blob_name).delete_blob()
|
|
1055
1064
|
deleted.append(blob_name)
|
|
1056
1065
|
except ResourceNotFoundError:
|
|
1057
1066
|
pass
|
|
1058
1067
|
|
|
1059
|
-
# Delete all blobs under the prefix
|
|
1060
|
-
for blob in children:
|
|
1061
|
-
self._get_blob_client(blob_name=blob.name).delete_blob()
|
|
1062
|
-
deleted.append(blob.name)
|
|
1063
|
-
|
|
1064
1068
|
if not deleted:
|
|
1065
1069
|
raise FileNotFoundError(f"Blob not found: {blob_name}")
|
|
1066
1070
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|