]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add empty initialize_connection method to PureBaseVolumeDriver
authorPatrick East <patrick.east@purestorage.com>
Fri, 18 Dec 2015 20:35:42 +0000 (12:35 -0800)
committerPatrick East <patrick.east@purestorage.com>
Fri, 18 Dec 2015 22:49:01 +0000 (14:49 -0800)
This will clean up a weird workaround needed for the unit tests…

Change-Id: Ie3db74516c74d15237617ac741d3061bd46212d2
Closes-Bug: 1527739

cinder/tests/unit/test_pure.py
cinder/volume/drivers/pure.py

index 83d385d624eaba3cee77af5db2e61ecc193bff7c..6e2a0d81e276192d2120b48f82f390abf5a90140 100644 (file)
@@ -226,15 +226,10 @@ class PureDriverTestCase(test.TestCase):
 
 
 class PureBaseVolumeDriverTestCase(PureDriverTestCase):
-
-    class fake_pure_base_volume_driver(pure.PureBaseVolumeDriver):
-        def initialize_connection():
-            pass
-
     def setUp(self):
         super(PureBaseVolumeDriverTestCase, self).setUp()
-        self.driver = self.fake_pure_base_volume_driver(
-            configuration=self.mock_config)
+        self.driver = pure.PureBaseVolumeDriver(configuration=self.mock_config)
+
         self.driver._array = self.array
         self.array.get_rest_version.return_value = '1.4'
 
index 66c6c8214f7d34a39ce9a7b0ee8e931be30a9967..e8c930bbe185771e423d82ba83736d344cd74e9d 100644 (file)
@@ -216,6 +216,13 @@ class PureBaseVolumeDriver(san.SanDriver):
     def create_export(self, context, volume, connector):
         pass
 
+    def initialize_connection(self, volume, connector, initiator_data=None):
+        """Connect the volume to the specified initiator in Purity.
+
+        This implementation is specific to the host type (iSCSI, FC, etc).
+        """
+        raise NotImplementedError
+
     def _get_host(self, connector):
         """Get a Purity Host that corresponds to the host in the connector.