From fdca2909de273d38d3c9c03e5b44343fd2bbe0be Mon Sep 17 00:00:00 2001 From: Valeriy Ponomaryov Date: Mon, 21 Sep 2015 11:12:52 +0300 Subject: [PATCH] Fix error response when denying snapshot creation If we try to create snapshot from share that is not snapshottable we expect error that it is not possible and proper description for it. Now we get some abstract message "ERROR: Unable to process the contained instructions". So, make API provide proper information about error. Change-Id: I16a2f7c80102159c30f91af7e045e73ee3df7f89 Closes-Bug: #1496408 --- manila/api/v1/share_snapshots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manila/api/v1/share_snapshots.py b/manila/api/v1/share_snapshots.py index c5b9acf98a..94cfe83dd3 100644 --- a/manila/api/v1/share_snapshots.py +++ b/manila/api/v1/share_snapshots.py @@ -155,7 +155,7 @@ class ShareSnapshotsController(wsgi.Controller): msg = _("Snapshot cannot be created from share '%s', because " "share back end does not support it.") % share_id LOG.error(msg) - raise exc.HTTPUnprocessableEntity(msg) + raise exc.HTTPUnprocessableEntity(explanation=msg) LOG.info(_LI("Create snapshot from share %s"), share_id, context=context)