in parallel_delete_blobs.py [0:0]
def delete_blob(container_client, blob_path):
if verify_existence:
if not blob_exists(container_client,blob_path):
print('Warning: {} does not exist'.format(blob_path))
return
if not execute_deletions:
if verbose:
print('Not deleting {}'.format(blob_path))
return
try:
if verbose:
print('Deleting {}'.format(blob_path))
blob_client = container_client.get_blob_client(blob_path)
blob_client.delete_blob()
except Exception as e:
if verbose:
s = str(e)
if 'BlobNotFound' in s:
print('{} does not exist'.format(blob_path))
else:
print('Error deleting {}: {}'.format(blob_path,s))
if sleep_time_after_deletion > 0:
time.sleep(sleep_time_after_deletion)