]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
coraid: fix snapshot deletion
authorRoman Bogorodskiy <rbogorodskiy@mirantis.com>
Thu, 4 Sep 2014 10:04:59 +0000 (10:04 +0000)
committerRoman Bogorodskiy <rbogorodskiy@mirantis.com>
Fri, 12 Sep 2014 17:04:33 +0000 (17:04 +0000)
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
cinder/volume/drivers/coraid.py

index 63edb9581bdeb87ade6c75eb3415f5ecd3683ba3..7ee9573bee2789e9f4f923caa24f7bc7fc497438 100644 (file)
@@ -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)
index d97b21000394c0f662a69c1ef2a121ad02a66be6..652ae43a95ff0454a79a46f960f4d07aefb1caa6 100644 (file)
@@ -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)