Merge "Refactor Nexenta iSCSI driver"

This commit is contained in:
Jenkins 2013-10-13 05:29:00 +00:00 committed by Gerrit Code Review
commit 03e35bcce0
4 changed files with 13 additions and 10 deletions

View File

@ -25,7 +25,7 @@ CONF = cfg.CONF
RBD_MODULE = "cinder.volume.drivers.rbd.RBDDriver" RBD_MODULE = "cinder.volume.drivers.rbd.RBDDriver"
SHEEPDOG_MODULE = "cinder.volume.drivers.sheepdog.SheepdogDriver" SHEEPDOG_MODULE = "cinder.volume.drivers.sheepdog.SheepdogDriver"
NEXENTA_MODULE = "cinder.volume.drivers.nexenta.volume.NexentaDriver" NEXENTA_MODULE = "cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver"
SAN_MODULE = "cinder.volume.drivers.san.san.SanISCSIDriver" SAN_MODULE = "cinder.volume.drivers.san.san.SanISCSIDriver"
SOLARIS_MODULE = "cinder.volume.drivers.san.solaris.SolarisISCSIDriver" SOLARIS_MODULE = "cinder.volume.drivers.san.solaris.SolarisISCSIDriver"
LEFTHAND_MODULE = "cinder.volume.drivers.san.hp_lefthand.HpSanISCSIDriver" LEFTHAND_MODULE = "cinder.volume.drivers.san.hp_lefthand.HpSanISCSIDriver"

View File

@ -28,12 +28,12 @@ from cinder import test
from cinder import units from cinder import units
from cinder.volume import configuration as conf from cinder.volume import configuration as conf
from cinder.volume.drivers import nexenta from cinder.volume.drivers import nexenta
from cinder.volume.drivers.nexenta import iscsi
from cinder.volume.drivers.nexenta import jsonrpc from cinder.volume.drivers.nexenta import jsonrpc
from cinder.volume.drivers.nexenta import nfs from cinder.volume.drivers.nexenta import nfs
from cinder.volume.drivers.nexenta import volume
class TestNexentaDriver(test.TestCase): class TestNexentaISCSIDriver(test.TestCase):
TEST_VOLUME_NAME = 'volume1' TEST_VOLUME_NAME = 'volume1'
TEST_VOLUME_NAME2 = 'volume2' TEST_VOLUME_NAME2 = 'volume2'
TEST_SNAPSHOT_NAME = 'snapshot1' TEST_SNAPSHOT_NAME = 'snapshot1'
@ -53,10 +53,10 @@ class TestNexentaDriver(test.TestCase):
} }
def __init__(self, method): def __init__(self, method):
super(TestNexentaDriver, self).__init__(method) super(TestNexentaISCSIDriver, self).__init__(method)
def setUp(self): def setUp(self):
super(TestNexentaDriver, self).setUp() super(TestNexentaISCSIDriver, self).setUp()
self.configuration = mox_lib.MockObject(conf.Configuration) self.configuration = mox_lib.MockObject(conf.Configuration)
self.configuration.nexenta_host = '1.1.1.1' self.configuration.nexenta_host = '1.1.1.1'
self.configuration.nexenta_user = 'admin' self.configuration.nexenta_user = 'admin'
@ -75,7 +75,7 @@ class TestNexentaDriver(test.TestCase):
setattr(self.nms_mock, mod, self.mox.CreateMockAnything()) setattr(self.nms_mock, mod, self.mox.CreateMockAnything())
self.stubs.Set(jsonrpc, 'NexentaJSONProxy', self.stubs.Set(jsonrpc, 'NexentaJSONProxy',
lambda *_, **__: self.nms_mock) lambda *_, **__: self.nms_mock)
self.drv = volume.NexentaDriver(configuration=self.configuration) self.drv = iscsi.NexentaISCSIDriver(configuration=self.configuration)
self.drv.do_setup({}) self.drv.do_setup({})
def test_setup_error(self): def test_setup_error(self):

View File

@ -42,19 +42,20 @@ CONF.register_opts(options.NEXENTA_ISCSI_OPTIONS)
CONF.register_opts(options.NEXENTA_VOLUME_OPTIONS) CONF.register_opts(options.NEXENTA_VOLUME_OPTIONS)
class NexentaDriver(driver.ISCSIDriver): # pylint: disable=R0921 class NexentaISCSIDriver(driver.ISCSIDriver): # pylint: disable=R0921
"""Executes volume driver commands on Nexenta Appliance. """Executes volume driver commands on Nexenta Appliance.
Version history: Version history:
1.0.0 - Initial driver version. 1.0.0 - Initial driver version.
1.0.1 - Fixed bug #1236626: catch "does not exist" exception of 1.0.1 - Fixed bug #1236626: catch "does not exist" exception of
lu_exists. lu_exists.
1.1.0 - Changed class name to NexentaISCSIDriver.
""" """
VERSION = '1.0.1' VERSION = '1.1.0'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(NexentaDriver, self).__init__(*args, **kwargs) super(NexentaISCSIDriver, self).__init__(*args, **kwargs)
self.nms = None self.nms = None
if self.configuration: if self.configuration:
self.configuration.append_config_values( self.configuration.append_config_values(

View File

@ -92,7 +92,9 @@ MAPPING = {
'cinder.volume.driver.SheepdogDriver': 'cinder.volume.driver.SheepdogDriver':
'cinder.volume.drivers.sheepdog.SheepdogDriver', 'cinder.volume.drivers.sheepdog.SheepdogDriver',
'cinder.volume.nexenta.volume.NexentaDriver': 'cinder.volume.nexenta.volume.NexentaDriver':
'cinder.volume.drivers.nexenta.volume.NexentaDriver', 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
'cinder.volume.drivers.nexenta.volume.NexentaDriver':
'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
'cinder.volume.san.SanISCSIDriver': 'cinder.volume.san.SanISCSIDriver':
'cinder.volume.drivers.san.san.SanISCSIDriver', 'cinder.volume.drivers.san.san.SanISCSIDriver',
'cinder.volume.san.SolarisISCSIDriver': 'cinder.volume.san.SolarisISCSIDriver':