Refactor Nexenta iSCSI driver

1) Rename volume.py to iscsi.py
2) Rename NexentaDriver to NexentaISCSIDriver

DocImpact
Change-Id: I117d881e1f5a70ea50e44c4a409e65961b85978f
This commit is contained in:
Victor Rodionov 2013-09-05 02:02:51 +04:00
parent 1f10e290b3
commit 9b9aee668b
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"
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"
SOLARIS_MODULE = "cinder.volume.drivers.san.solaris.SolarisISCSIDriver"
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.volume import configuration as conf
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 nfs
from cinder.volume.drivers.nexenta import volume
class TestNexentaDriver(test.TestCase):
class TestNexentaISCSIDriver(test.TestCase):
TEST_VOLUME_NAME = 'volume1'
TEST_VOLUME_NAME2 = 'volume2'
TEST_SNAPSHOT_NAME = 'snapshot1'
@ -53,10 +53,10 @@ class TestNexentaDriver(test.TestCase):
}
def __init__(self, method):
super(TestNexentaDriver, self).__init__(method)
super(TestNexentaISCSIDriver, self).__init__(method)
def setUp(self):
super(TestNexentaDriver, self).setUp()
super(TestNexentaISCSIDriver, self).setUp()
self.configuration = mox_lib.MockObject(conf.Configuration)
self.configuration.nexenta_host = '1.1.1.1'
self.configuration.nexenta_user = 'admin'
@ -75,7 +75,7 @@ class TestNexentaDriver(test.TestCase):
setattr(self.nms_mock, mod, self.mox.CreateMockAnything())
self.stubs.Set(jsonrpc, 'NexentaJSONProxy',
lambda *_, **__: self.nms_mock)
self.drv = volume.NexentaDriver(configuration=self.configuration)
self.drv = iscsi.NexentaISCSIDriver(configuration=self.configuration)
self.drv.do_setup({})
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)
class NexentaDriver(driver.ISCSIDriver): # pylint: disable=R0921
class NexentaISCSIDriver(driver.ISCSIDriver): # pylint: disable=R0921
"""Executes volume driver commands on Nexenta Appliance.
Version history:
1.0.0 - Initial driver version.
1.0.1 - Fixed bug #1236626: catch "does not exist" exception of
lu_exists.
1.1.0 - Changed class name to NexentaISCSIDriver.
"""
VERSION = '1.0.1'
VERSION = '1.1.0'
def __init__(self, *args, **kwargs):
super(NexentaDriver, self).__init__(*args, **kwargs)
super(NexentaISCSIDriver, self).__init__(*args, **kwargs)
self.nms = None
if self.configuration:
self.configuration.append_config_values(

View File

@ -92,7 +92,9 @@ MAPPING = {
'cinder.volume.driver.SheepdogDriver':
'cinder.volume.drivers.sheepdog.SheepdogDriver',
'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.drivers.san.san.SanISCSIDriver',
'cinder.volume.san.SolarisISCSIDriver':