From fa9ac6d78216bcddda36f60bb36476da91b2e521 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Wed, 21 Apr 2021 09:38:33 -0400 Subject: [PATCH] Fix api error message for snapshot creation failure when the source share has ``snapshot_support`` False. The message said that the back end lacks snapshot support but this is not necessarily the case. Closes-bug: #1925342 Change-Id: I09a83b63528c0988f3601dfd07ad6972165cb855 (cherry picked from commit be29805859f0e759cfd96b5e1ef0afbd1d16f3c0) (cherry picked from commit fb5a4f936d6ecf7435005f72ef8d7068cf75f65e) --- manila/api/v1/share_snapshots.py | 4 ++-- ...napshot-support-api-error-msg-eaf5fd2b1df97d15.yaml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1925342-fix-snapshot-support-api-error-msg-eaf5fd2b1df97d15.yaml diff --git a/manila/api/v1/share_snapshots.py b/manila/api/v1/share_snapshots.py index ccf45d4bc7..46989129fa 100644 --- a/manila/api/v1/share_snapshots.py +++ b/manila/api/v1/share_snapshots.py @@ -181,8 +181,8 @@ class ShareSnapshotMixin(object): # Verify that share can be snapshotted if not share['snapshot_support']: - msg = _("Snapshot cannot be created from share '%s', because " - "share back end does not support it.") % share_id + msg = _("Snapshots cannot be created for share '%s' " + "since it does not have that capability.") % share_id LOG.error(msg) raise exc.HTTPUnprocessableEntity(explanation=msg) diff --git a/releasenotes/notes/bug-1925342-fix-snapshot-support-api-error-msg-eaf5fd2b1df97d15.yaml b/releasenotes/notes/bug-1925342-fix-snapshot-support-api-error-msg-eaf5fd2b1df97d15.yaml new file mode 100644 index 0000000000..a234a3e9e2 --- /dev/null +++ b/releasenotes/notes/bug-1925342-fix-snapshot-support-api-error-msg-eaf5fd2b1df97d15.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + Corrected an error message for attempts to create snapshots from shares + that do not support this operation. The message said that the share + backend has no such support but that is not always true. The original + share for the snapshot does not support snapshots because it was created + with a share type without the ``snapshot_support`` extra-spec set, + irrespective of whether the back end used can itself support snapshots + or not.