From 9481fc016f880b70b4c7d2e32108a942b8fd7f77 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Tue, 7 May 2013 05:47:32 -0600 Subject: [PATCH] Move iscsi helpers to brick directory. This patch moves the iscsi helpers to the brick directory. We're doing this to enable the ability to have a module/library of core block storage functionality to use in other OpenStack projects. After this the next step is to separate out the LVM and iSCSI code in drivers/lvm.py and then to actually have the Cinder LVM driver use the new brick LVM module. Change-Id: I4f8f8b54e801ab63994b5953956c041d8db91fad --- cinder/brick/iscsi/__init__.py | 16 ++++++++++++++++ cinder/{volume => brick/iscsi}/iscsi.py | 0 cinder/tests/test_iscsi.py | 2 +- cinder/tests/test_volume.py | 2 +- cinder/volume/driver.py | 2 +- cinder/volume/drivers/lvm.py | 2 +- cinder/volume/drivers/zadara.py | 1 - 7 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 cinder/brick/iscsi/__init__.py rename cinder/{volume => brick/iscsi}/iscsi.py (100%) diff --git a/cinder/brick/iscsi/__init__.py b/cinder/brick/iscsi/__init__.py new file mode 100644 index 000000000..5e8da711f --- /dev/null +++ b/cinder/brick/iscsi/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2013 OpenStack Foundation. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/cinder/volume/iscsi.py b/cinder/brick/iscsi/iscsi.py similarity index 100% rename from cinder/volume/iscsi.py rename to cinder/brick/iscsi/iscsi.py diff --git a/cinder/tests/test_iscsi.py b/cinder/tests/test_iscsi.py index c20a99f26..321e80514 100644 --- a/cinder/tests/test_iscsi.py +++ b/cinder/tests/test_iscsi.py @@ -19,8 +19,8 @@ import shutil import string import tempfile +from cinder.brick.iscsi import iscsi from cinder import test -from cinder.volume import iscsi from cinder.volume import utils as volume_utils diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 744baf5b4..55cd8a256 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -27,6 +27,7 @@ import mox import shutil import tempfile +from cinder.brick.iscsi import iscsi from cinder import context from cinder import db from cinder import exception @@ -43,7 +44,6 @@ from cinder.tests import fake_flags from cinder.tests.image import fake as fake_image from cinder.volume import configuration as conf from cinder.volume import driver -from cinder.volume import iscsi QUOTAS = quota.QUOTAS FLAGS = flags.FLAGS diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 03f18a2b7..275ced42f 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -61,7 +61,7 @@ volume_opts = [ CONF = cfg.CONF CONF.register_opts(volume_opts) -CONF.import_opt('iscsi_helper', 'cinder.volume.iscsi') +CONF.import_opt('iscsi_helper', 'cinder.brick.iscsi.iscsi') class VolumeDriver(object): diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 02adca603..7317c2901 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -26,13 +26,13 @@ import re from oslo.config import cfg +from cinder.brick.iscsi import iscsi from cinder import exception from cinder import flags from cinder.image import image_utils from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver -from cinder.volume import iscsi LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/zadara.py b/cinder/volume/drivers/zadara.py index e991f8d16..988ac647a 100644 --- a/cinder/volume/drivers/zadara.py +++ b/cinder/volume/drivers/zadara.py @@ -31,7 +31,6 @@ from cinder import flags from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver -from cinder.volume import iscsi LOG = logging.getLogger("cinder.volume.driver") -- 2.45.2