Comment 6 for bug 1899495

Revision history for this message
Tim Burke (1-tim-z) wrote :

Oh, so it does.

Stepping back a bit, it looks like the only container delete in glance_store is in MultiTenantStore.delete: https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/swift/store.py#L1507-L1512

It seems like the idea is to delete a specific image, and it's just trying to clean up the container in case it's now empty. You said it was sporadic, but it seems like if you've got multiple images in a container, deleting the first one should reliably trip the 409. Probably want to get the opinion of someone better acquainted with glance, but I think we might just need that last line to be something like

    try:
        # try to clean up the container, too
        connection.delete_container(location.store_location.container)
    except swiftclient.ClientException as e:
        if e.http_status != http_client.CONFLICT:
            raise
        # else, must not be empty yet