From b39446b46b83af2dcf36f091ed9dcaf4d29410cf Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Thu, 4 Sep 2014 10:04:59 +0000 Subject: [PATCH] coraid: fix snapshot deletion Currently, a request to ESM API for a snapshot deletion looks this way: {'addr': 'cms', 'data': { 'repoName': repository_name, 'lvName': snapshot_name}, 'op': 'orchStrLunMods', 'args': 'delClSnap'} This is correct, however, some versions of the ESM API have a bug that prevents it from validation this valid request and it fails with: Must define the new LV name to be assigned to the clone/clSnap. As a workaround for this bug, provide an 'newLvName' property with a 'noop' value to make the validation pass even on buggy versions. Fixes bug #1365417 Change-Id: I3fd7f3c6a64cac992735b098368b52b9ab21d85c --- cinder/tests/test_coraid.py | 3 ++- cinder/volume/drivers/coraid.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cinder/tests/test_coraid.py b/cinder/tests/test_coraid.py index 63edb9581..7ee9573be 100644 --- a/cinder/tests/test_coraid.py +++ b/cinder/tests/test_coraid.py @@ -489,7 +489,8 @@ class CoraidDriverIntegrationalTestCase(CoraidDriverLoginSuccessTestCase): delete_snapshot_request = {'addr': 'cms', 'data': { 'repoName': fake_repository_name, - 'lvName': fake_snapshot_name}, + 'lvName': fake_snapshot_name, + 'newLvName': 'noop'}, 'op': 'orchStrLunMods', 'args': 'delClSnap'} pack_data(delete_snapshot_request) diff --git a/cinder/volume/drivers/coraid.py b/cinder/volume/drivers/coraid.py index d97b21000..652ae43a9 100644 --- a/cinder/volume/drivers/coraid.py +++ b/cinder/volume/drivers/coraid.py @@ -353,7 +353,12 @@ class CoraidAppliance(object): request = {'addr': 'cms', 'data': { 'repoName': repository_name, - 'lvName': snapshot_name}, + 'lvName': snapshot_name, + # NOTE(novel): technically, the 'newLvName' is not + # required for 'delClSnap' command. However, some + # versions of ESM have a bug that fails validation + # if we don't specify that. Hence, this fake value. + 'newLvName': "noop"}, 'op': 'orchStrLunMods', 'args': 'delClSnap'} esm_result = self.esm_command(request) -- 2.45.2