]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Eqlx fix NoSuchOptError for volume_name_template on clone
authorSean McGinnis <sean_mcginnis@dell.com>
Tue, 7 Oct 2014 15:10:57 +0000 (10:10 -0500)
committerSean McGinnis <sean_mcginnis@dell.com>
Thu, 9 Oct 2014 13:20:04 +0000 (08:20 -0500)
The eqlx driver was referencing the volume_name_template
config setting via self.configuration.volume_name_template.
This option is not imported in self.configuration.

The curent preferred method for volume clone is to reference
the passed in name, avoiding the need for the driver to
know what the naming template is all together.

Change-Id: If4963bbe61574c006ad04e5e88d04c7f7bc7cee1
Closes-Bug: 1378369

cinder/tests/test_eqlx.py
cinder/volume/drivers/eqlx.py

index 4ddbab8d539122670cf4a7b9e2520087a2444ebc..4324bed0505fca67766134f7c481406eea3d02f0 100644 (file)
@@ -49,7 +49,6 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
         self.configuration.eqlx_cli_max_retries = 5
         self.configuration.eqlx_chap_login = 'admin'
         self.configuration.eqlx_chap_password = 'password'
-        self.configuration.volume_name_template = 'volume_%s'
         self._context = context.get_admin_context()
         self.driver = eqlx.DellEQLSanISCSIDriver(
             configuration=self.configuration)
@@ -159,11 +158,9 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
     def test_create_cloned_volume(self):
         self.driver._eql_execute = self.mox.\
             CreateMock(self.driver._eql_execute)
-        src_vref = {'id': 'fake_uuid'}
+        src_vref = {'name': 'fake_uuid'}
         volume = {'name': self.volume_name}
-        src_volume_name = self.configuration.\
-            volume_name_template % src_vref['id']
-        self.driver._eql_execute('volume', 'select', src_volume_name, 'clone',
+        self.driver._eql_execute('volume', 'select', src_vref['name'], 'clone',
                                  volume['name']).\
             AndReturn(['iSCSI target name is %s.' % self.fake_iqn])
         self.driver._eql_execute('volume', 'select', volume['name'],
index a4a778c6790e0a7a6401e3cf72d2e60f050ebf42..81dfff021308c3d022d7d52894b2aee88388e848 100644 (file)
@@ -410,8 +410,7 @@ class DellEQLSanISCSIDriver(SanISCSIDriver):
     def create_cloned_volume(self, volume, src_vref):
         """Creates a clone of the specified volume."""
         try:
-            src_volume_name = self.configuration.\
-                volume_name_template % src_vref['id']
+            src_volume_name = src_vref['name']
             out = self._eql_execute('volume', 'select', src_volume_name,
                                     'clone', volume['name'])
             self.add_multihost_access(volume)