summaryrefslogtreecommitdiff
path: root/glance_store/exceptions.py
diff options
context:
space:
mode:
authorMingda Sun <mingda@unitedstack.com>2015-07-14 17:30:05 +0800
committerMingda Sun <mingda@unitedstack.com>2015-08-10 23:21:21 -0400
commit5b2eec73f2822e42f29d2151728ce03676cbc8cb (patch)
tree903dff41845afd673a4d3497dd037c0fef1a8703 /glance_store/exceptions.py
parent425360035676d4bb88b8b5eea3d7ccabb65e850a (diff)
downloadglance_store-5b2eec73f2822e42f29d2151728ce03676cbc8cb.tar.gz
rbd driver cannot delete residual image from ceph in some cases
RBD supports a mechanism that when add image operation failed, rollback operation will be triggered (delete residual image if it was created). When uploading image through glance api failed, however, the incomplete image has not been taken snapshot yet, then rollback operation do unprotect snap will throw exception "rbd.ImageNotFound". This exception will lead to the code relating to remove residual image from ceph, which is the true purpose of rollback, has been skipped. Thus, re-uploading image will failed using the same image id due to above reason (residual image already exists) & residual image need to be deleted manually from ceph. Closes-Bug: #1473953 Change-Id: Ib5a0642350b62f8fdaec3569a3ccce6ac4b8a5fc modified: glance_store/_drivers/rbd.py modified: glance_store/exceptions.py modified: glance_store/tests/unit/test_rbd_store.py
Diffstat (limited to 'glance_store/exceptions.py')
-rw-r--r--glance_store/exceptions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/glance_store/exceptions.py b/glance_store/exceptions.py
index 79af298..66264c2 100644
--- a/glance_store/exceptions.py
+++ b/glance_store/exceptions.py
@@ -195,6 +195,10 @@ class UnsupportedHeaderFeature(GlanceStoreException):
message = _("Provided header feature is unsupported: %(feature)s")
+class HasSnapshot(GlanceStoreException):
+ message = _("The image cannot be deleted because it has snapshot(s).")
+
+
class InUseByStore(GlanceStoreException):
message = _("The image cannot be deleted because it is in use through "
"the backend store outside of Glance.")