]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Update Violin REST client library name
authorRyan Lucio <rlucio@vmem.com>
Tue, 10 Mar 2015 00:00:09 +0000 (17:00 -0700)
committerRyan Lucio <rlucio@vmem.com>
Tue, 17 Mar 2015 04:20:54 +0000 (21:20 -0700)
Fixed all drivers and tests to use the 'vmemclient' library.

Change-Id: I337e67ecd7c45d7b28e1bc4a551245ec0705ea31
Closes-bug: 1430009

cinder/tests/fake_vmem_client.py [moved from cinder/tests/fake_vmem_xgtools_client.py with 89% similarity]
cinder/tests/test_v6000_common.py
cinder/tests/test_v6000_fcp.py
cinder/tests/test_v6000_iscsi.py
cinder/volume/drivers/violin/v6000_common.py
cinder/volume/drivers/violin/v6000_fcp.py
cinder/volume/drivers/violin/v6000_iscsi.py

similarity index 89%
rename from cinder/tests/fake_vmem_xgtools_client.py
rename to cinder/tests/fake_vmem_client.py
index 35316509917f675c033fface2276bffac2d6cd41..25255a3c704652c002467729b63179659a3f89db 100644 (file)
@@ -14,8 +14,7 @@
 #    under the License.
 
 """
-Fake VMEM XG-Tools client for testing drivers.  Inspired by
-cinder/tests/fake_hp_3par_client.py.
+Fake VMEM REST client for testing drivers.
 """
 
 import sys
@@ -25,7 +24,7 @@ import mock
 vmemclient = mock.Mock()
 vmemclient.__version__ = "unknown"
 
-sys.modules['vxg'] = vmemclient
+sys.modules['vmemclient'] = vmemclient
 
 mock_client_conf = [
     'basic',
index 69822399c4c3d15a01c9e46a912f7f02b162b633..2dbe3e511021f4ac87138e008ad9b6c3212ecd6c 100644 (file)
@@ -21,7 +21,7 @@ import mock
 
 from cinder import exception
 from cinder import test
-from cinder.tests import fake_vmem_xgtools_client as vxg
+from cinder.tests import fake_vmem_client as vmemclient
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.violin import v6000_common
 
@@ -90,23 +90,23 @@ class V6000CommonTestCase(test.TestCase):
         config.container = 'myContainer'
         return config
 
-    @mock.patch('vxg.open')
+    @mock.patch('vmemclient.open')
     def setup_mock_client(self, _m_client, m_conf=None):
         """Create a fake backend communication factory.
 
-        The xg-tools creates a VShare connection object (for V6000
-        devices) and returns it for use on a call to vxg.open().
+        The vmemclient creates a VShare connection object (for V6000
+        devices) and returns it for use on a call to vmemclient.open().
         """
         # configure the vshare object mock with defaults
         _m_vshare = mock.Mock(name='VShare',
                               version='1.1.1',
-                              spec=vxg.mock_client_conf)
+                              spec=vmemclient.mock_client_conf)
 
         # if m_conf, clobber the defaults with it
         if m_conf:
             _m_vshare.configure_mock(**m_conf)
 
-        # set calls to vxg.open() to return this mocked vshare object
+        # set calls to vmemclient.open() to return this mocked vshare object
         _m_client.return_value = _m_vshare
 
         return _m_client
@@ -115,7 +115,7 @@ class V6000CommonTestCase(test.TestCase):
         """Create a fake VShare communication object."""
         _m_vshare = mock.Mock(name='VShare',
                               version='1.1.1',
-                              spec=vxg.mock_client_conf)
+                              spec=vmemclient.mock_client_conf)
 
         if m_conf:
             _m_vshare.configure_mock(**m_conf)
index c796446cb37e56074821f6546b36cce36bdffa85..f0448be99364b0a1584cc0c3104085a89e360422 100644 (file)
@@ -24,7 +24,7 @@ from cinder import context
 from cinder.db.sqlalchemy import models
 from cinder import exception
 from cinder import test
-from cinder.tests import fake_vmem_xgtools_client as vxg
+from cinder.tests import fake_vmem_client as vmemclient
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.violin import v6000_common
 from cinder.volume.drivers.violin import v6000_fcp
@@ -120,7 +120,7 @@ class V6000FCPDriverTestCase(test.TestCase):
         """Create a fake VShare communication object."""
         _m_vshare = mock.Mock(name='VShare',
                               version='1.1.1',
-                              spec=vxg.mock_client_conf)
+                              spec=vmemclient.mock_client_conf)
 
         if m_conf:
             _m_vshare.configure_mock(**m_conf)
index c87df966f3516835e3db84a6c927ff185e8ae27d..9dddb040b2f7aca009f3198b3349de3caaaefb01 100644 (file)
@@ -24,7 +24,7 @@ from cinder import context
 from cinder.db.sqlalchemy import models
 from cinder import exception
 from cinder import test
-from cinder.tests import fake_vmem_xgtools_client as vxg
+from cinder.tests import fake_vmem_client as vmemclient
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.violin import v6000_common
 from cinder.volume.drivers.violin import v6000_iscsi
@@ -109,7 +109,7 @@ class V6000ISCSIDriverTestCase(test.TestCase):
         """Create a fake VShare communication object."""
         _m_vshare = mock.Mock(name='VShare',
                               version='1.1.1',
-                              spec=vxg.mock_client_conf)
+                              spec=vmemclient.mock_client_conf)
 
         if m_conf:
             _m_vshare.configure_mock(**m_conf)
index 16238393362353fd59025a4a4e51c6ab36d1621b..fafd97229035c9edab153f4b40a7d2536f787b6d 100644 (file)
@@ -20,7 +20,7 @@ Provides common (ie., non-protocol specific) management functions for
 V6000 series flash arrays.
 
 Backend array communication is handled via VMEM's python library
-called 'xg-tools'.
+called 'vmemclient'.
 
 NOTE: this driver file requires the use of synchronization points for
 certain types of backend operations, and as a result may not work
@@ -42,9 +42,10 @@ from cinder import utils
 
 LOG = logging.getLogger(__name__)
 
-vxg = importutils.try_import("vxg")
-if vxg:
-    LOG.info(_LI("Running with xg-tools version: %s."), vxg.__version__)
+vmemclient = importutils.try_import("vmemclient")
+if vmemclient:
+    LOG.info(_LI("Running with vmemclient version: %s."),
+             vmemclient.__version__)
 
 # version vmos versions V6.3.0.4 or newer
 VMOS_SUPPORTED_VERSION_PATTERNS = ['V6.3.0.[4-9]', 'V6.3.[1-9].?[0-9]?']
@@ -100,12 +101,15 @@ class V6000Common(object):
                 reason=_('Global timeout option \'request_timeout\' must be '
                          'greater than 0'))
 
-        self.vip = vxg.open(self.config.san_ip, self.config.san_login,
-                            self.config.san_password, keepalive=True)
-        self.mga = vxg.open(self.config.gateway_mga, self.config.san_login,
-                            self.config.san_password, keepalive=True)
-        self.mgb = vxg.open(self.config.gateway_mgb, self.config.san_login,
-                            self.config.san_password, keepalive=True)
+        self.vip = vmemclient.open(self.config.san_ip,
+                                   self.config.san_login,
+                                   self.config.san_password, keepalive=True)
+        self.mga = vmemclient.open(self.config.gateway_mga,
+                                   self.config.san_login,
+                                   self.config.san_password, keepalive=True)
+        self.mgb = vmemclient.open(self.config.gateway_mgb,
+                                   self.config.san_login,
+                                   self.config.san_password, keepalive=True)
 
         ret_dict = self.vip.basic.get_node_values(
             "/vshare/state/local/container/*")
index e13a30142f24b8848f3d5bbb6067ac4fb54ecda0..ce82a184da94d740cb17755060c6922615525a96 100644 (file)
@@ -21,8 +21,8 @@ arrays.
 
 This driver requires VMOS v6.3.0.4 or newer software on the array.
 
-You will need to install the python xg-tools client:
-sudo pip install xg-tools
+You will need to install the Violin Memory REST client library:
+sudo pip install vmemclient
 
 Set the following in the cinder.conf file to enable the VMEM V6000
 Fibre Channel Driver along with the required flags:
index d90fc48df701fd2ac838cad6974d4eeb92a9b792..31c7f8392df7d5d685ab745db17bb88730f37707 100644 (file)
@@ -20,8 +20,8 @@ Provides iSCSI specific LUN services for V6000 series flash arrays.
 
 This driver requires VMOS v6.3.0.4 or newer software on the array.
 
-You will need to install the python xg-tools client:
-sudo pip install xg-tools
+You will need to install the Violin Memory REST client library:
+sudo pip install vmemclient
 
 Set the following in the cinder.conf file to enable the VMEM V6000
 ISCSI Driver along with the required flags: