From: Ryan Lucio Date: Tue, 10 Mar 2015 00:00:09 +0000 (-0700) Subject: Update Violin REST client library name X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=da3d27b23b1801f917fcf8e3656ea55a9f83863e;p=openstack-build%2Fcinder-build.git Update Violin REST client library name Fixed all drivers and tests to use the 'vmemclient' library. Change-Id: I337e67ecd7c45d7b28e1bc4a551245ec0705ea31 Closes-bug: 1430009 --- diff --git a/cinder/tests/fake_vmem_xgtools_client.py b/cinder/tests/fake_vmem_client.py similarity index 89% rename from cinder/tests/fake_vmem_xgtools_client.py rename to cinder/tests/fake_vmem_client.py index 353165099..25255a3c7 100644 --- a/cinder/tests/fake_vmem_xgtools_client.py +++ b/cinder/tests/fake_vmem_client.py @@ -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', diff --git a/cinder/tests/test_v6000_common.py b/cinder/tests/test_v6000_common.py index 69822399c..2dbe3e511 100644 --- a/cinder/tests/test_v6000_common.py +++ b/cinder/tests/test_v6000_common.py @@ -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) diff --git a/cinder/tests/test_v6000_fcp.py b/cinder/tests/test_v6000_fcp.py index c796446cb..f0448be99 100644 --- a/cinder/tests/test_v6000_fcp.py +++ b/cinder/tests/test_v6000_fcp.py @@ -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) diff --git a/cinder/tests/test_v6000_iscsi.py b/cinder/tests/test_v6000_iscsi.py index c87df966f..9dddb040b 100644 --- a/cinder/tests/test_v6000_iscsi.py +++ b/cinder/tests/test_v6000_iscsi.py @@ -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) diff --git a/cinder/volume/drivers/violin/v6000_common.py b/cinder/volume/drivers/violin/v6000_common.py index 162383933..fafd97229 100644 --- a/cinder/volume/drivers/violin/v6000_common.py +++ b/cinder/volume/drivers/violin/v6000_common.py @@ -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/*") diff --git a/cinder/volume/drivers/violin/v6000_fcp.py b/cinder/volume/drivers/violin/v6000_fcp.py index e13a30142..ce82a184d 100644 --- a/cinder/volume/drivers/violin/v6000_fcp.py +++ b/cinder/volume/drivers/violin/v6000_fcp.py @@ -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: diff --git a/cinder/volume/drivers/violin/v6000_iscsi.py b/cinder/volume/drivers/violin/v6000_iscsi.py index d90fc48df..31c7f8392 100644 --- a/cinder/volume/drivers/violin/v6000_iscsi.py +++ b/cinder/volume/drivers/violin/v6000_iscsi.py @@ -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: