From 662bd2adfbf155b03e83e65c5a3d9878bb67ec39 Mon Sep 17 00:00:00 2001
From: Patrick East <patrick.east@purestorage.com>
Date: Fri, 18 Dec 2015 12:35:42 -0800
Subject: [PATCH] Add empty initialize_connection method to
 PureBaseVolumeDriver
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

This will clean up a weird workaround needed for the unit tests…

Change-Id: Ie3db74516c74d15237617ac741d3061bd46212d2
Closes-Bug: 1527739
---
 cinder/tests/unit/test_pure.py | 9 ++-------
 cinder/volume/drivers/pure.py  | 7 +++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cinder/tests/unit/test_pure.py b/cinder/tests/unit/test_pure.py
index 83d385d62..6e2a0d81e 100644
--- a/cinder/tests/unit/test_pure.py
+++ b/cinder/tests/unit/test_pure.py
@@ -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'
 
diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py
index 66c6c8214..e8c930bbe 100644
--- a/cinder/volume/drivers/pure.py
+++ b/cinder/volume/drivers/pure.py
@@ -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.
 
-- 
2.45.2