From 78a532cdd672307f78397b5a1afa5386f47c5a07 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Mon, 10 Apr 2017 14:08:34 +0300 Subject: [PATCH] RemoteFS: fix volume cascade delete Attempting to delete a volume along with its snapshots fails for RemoteFS based drivers. The reason is that that the driver expects the volume status to be 'available', 'in-use' or 'backing-up', while in this situation the volume status would be 'deleting'. Most of those drivers apply locks to the volume/snapshot deletion methods, so it should be safe to just add 'deleting' to the list of acceptable volume states for this operation. Change-Id: I1242d03fb6bbbd40ac2dace1aa865a6f91c22d23 Closes-Bug: #1681406 --- cinder/volume/drivers/remotefs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py index f425a88b67a..a1faf0bb3ca 100644 --- a/cinder/volume/drivers/remotefs.py +++ b/cinder/volume/drivers/remotefs.py @@ -1012,9 +1012,10 @@ class RemoteFSSnapDriverBase(RemoteFSDriver): else 'offline')}) volume_status = snapshot.volume.status - if volume_status not in ['available', 'in-use', 'backing-up']: - msg = _("Volume status must be 'available', 'in-use' or " - "'backing-up' but is: " + if volume_status not in ['available', 'in-use', + 'backing-up', 'deleting']: + msg = _("Volume status must be 'available', 'in-use', " + "'backing-up' or 'deleting' but is: " "%(status)s.") % {'status': volume_status} raise exception.InvalidVolume(msg)