Move driver options to "backend_defaults" section

Our cinder.conf.sample lists all of the options that are defined by
drivers in the [DEFAULT] section. Since removal of single-backend config
(without enabled_backends) this is misleading as those options are
functional only when defined in [<backend_name>] section. This commit
aims to move all of the driver options to [backend_defaults] section.
Assumption is that this will affect only sample config generation and
should not break anything else.

Change-Id: Ia4766eb313e15adc92a92875519b22db64e95d65
This commit is contained in:
Michał Dulko 2017-04-05 14:52:30 +02:00
parent a688b872be
commit 1f62a411f4
104 changed files with 454 additions and 329 deletions

View File

@ -17,6 +17,8 @@ import os
import subprocess import subprocess
import textwrap import textwrap
from cinder.volume import configuration
OrderedDict = collections.OrderedDict OrderedDict = collections.OrderedDict
BASEDIR = os.path.split(os.path.realpath(__file__))[0] + "/../../" BASEDIR = os.path.split(os.path.realpath(__file__))[0] + "/../../"
@ -208,6 +210,12 @@ if __name__ == "__main__":
', group=\"\'', '').replace( ', group=\"\'', '').replace(
', group=', '').strip( ', group=', '').strip(
"\'\")").upper() "\'\")").upper()
# NOTE(dulek): Hack to resolve constants manually.
if (group_name.endswith('SHARED_CONF_GROUP')
or group_name.lower() == 'backend_defaults'):
group_name = configuration.SHARED_CONF_GROUP
if group_name in registered_opts_dict: if group_name in registered_opts_dict:
line = key + "." + formatted_opt line = key + "." + formatted_opt
registered_opts_dict[group_name].append(line) registered_opts_dict[group_name].append(line)

View File

@ -277,6 +277,29 @@ def list_opts():
[cinder_volume_api.volume_host_opt], [cinder_volume_api.volume_host_opt],
[cinder_volume_api.volume_same_az_opt], [cinder_volume_api.volume_same_az_opt],
[cinder_volume_api.az_cache_time_opt], [cinder_volume_api.az_cache_time_opt],
cinder_volume_driver.volume_opts,
cinder_volume_driver.iser_opts,
cinder_volume_manager.volume_manager_opts,
cinder_wsgi_eventletserver.socket_opts,
)),
('FC-ZONE-MANAGER',
itertools.chain(
cinder_zonemanager_drivers_brocade_brcdfczonedriver.brcd_opts,
cinder_zonemanager_drivers_cisco_ciscofczonedriver.cisco_opts,
cinder_zonemanager_fczonemanager.zone_manager_opts,
)),
('KEY_MANAGER',
itertools.chain(
cinder_keymgr_confkeymgr.key_mgr_opts,
)),
('NOVA_GROUP',
itertools.chain(
cinder_compute_nova.nova_opts,
cinder_compute_nova.nova_session_opts,
cinder_compute_nova.nova_auth_opts,
)),
('backend_defaults',
itertools.chain(
cinder_volume_driver.volume_opts, cinder_volume_driver.volume_opts,
cinder_volume_driver.iser_opts, cinder_volume_driver.iser_opts,
cinder_volume_drivers_blockdevice.volume_opts, cinder_volume_drivers_blockdevice.volume_opts,
@ -384,23 +407,6 @@ def list_opts():
cinder_volume_drivers_zfssa_zfssaiscsi.ZFSSA_OPTS, cinder_volume_drivers_zfssa_zfssaiscsi.ZFSSA_OPTS,
cinder_volume_drivers_zfssa_zfssanfs.ZFSSA_OPTS, cinder_volume_drivers_zfssa_zfssanfs.ZFSSA_OPTS,
cinder_volume_drivers_zte_zteks.zte_opts, cinder_volume_drivers_zte_zteks.zte_opts,
cinder_volume_manager.volume_manager_opts, cinder_volume_manager.volume_backend_opts,
cinder_wsgi_eventletserver.socket_opts,
)),
('FC-ZONE-MANAGER',
itertools.chain(
cinder_zonemanager_drivers_brocade_brcdfczonedriver.brcd_opts,
cinder_zonemanager_drivers_cisco_ciscofczonedriver.cisco_opts,
cinder_zonemanager_fczonemanager.zone_manager_opts,
)),
('KEY_MANAGER',
itertools.chain(
cinder_keymgr_confkeymgr.key_mgr_opts,
)),
('NOVA_GROUP',
itertools.chain(
cinder_compute_nova.nova_opts,
cinder_compute_nova.nova_session_opts,
cinder_compute_nova.nova_auth_opts,
)), )),
] ]

View File

@ -68,7 +68,8 @@ class _FunctionalTestBase(test.TestCase):
super(_FunctionalTestBase, self).setUp() super(_FunctionalTestBase, self).setUp()
f = self._get_flags() f = self._get_flags()
self.flags(**f) for k, value_dict in f.items():
self.override_config(k, value_dict['v'], value_dict.get('g'))
for var in ('http_proxy', 'HTTP_PROXY'): for var in ('http_proxy', 'HTTP_PROXY'):
self.useFixture(fixtures.EnvironmentVariable(var)) self.useFixture(fixtures.EnvironmentVariable(var))
@ -107,15 +108,15 @@ class _FunctionalTestBase(test.TestCase):
f = {} f = {}
# Ensure tests only listen on localhost # Ensure tests only listen on localhost
f['osapi_volume_listen'] = '127.0.0.1' f['osapi_volume_listen'] = {'v': '127.0.0.1'}
# Auto-assign ports to allow concurrent tests # Auto-assign ports to allow concurrent tests
f['osapi_volume_listen_port'] = 0 f['osapi_volume_listen_port'] = {'v': 0}
# Use simple scheduler to avoid complications - we test schedulers # Use simple scheduler to avoid complications - we test schedulers
# separately # separately
f['scheduler_driver'] = ('cinder.scheduler.filter_scheduler.FilterSche' f['scheduler_driver'] = {'v': ('cinder.scheduler.filter_scheduler.'
'duler') 'FilterScheduler')}
return f return f

View File

@ -32,8 +32,8 @@ CONF = cfg.CONF
class ExtensionTestCase(functional_helpers._FunctionalTestBase): class ExtensionTestCase(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(ExtensionTestCase, self)._get_flags() f = super(ExtensionTestCase, self)._get_flags()
f['osapi_volume_extension'] = CONF.osapi_volume_extension[:] f['osapi_volume_extension'] = {'v': CONF.osapi_volume_extension[:]}
f['osapi_volume_extension'].append( f['osapi_volume_extension']['v'].append(
'cinder.tests.functional.api.foxinsocks.Foxinsocks') 'cinder.tests.functional.api.foxinsocks.Foxinsocks')
return f return f

View File

@ -17,6 +17,7 @@ from oslo_utils import uuidutils
from cinder.objects import fields from cinder.objects import fields
from cinder.tests.functional import functional_helpers from cinder.tests.functional import functional_helpers
from cinder.volume import configuration
class GroupReplicationTest(functional_helpers._FunctionalTestBase): class GroupReplicationTest(functional_helpers._FunctionalTestBase):
@ -41,9 +42,10 @@ class GroupReplicationTest(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(GroupReplicationTest, self)._get_flags() f = super(GroupReplicationTest, self)._get_flags()
f['volume_driver'] = ( f['volume_driver'] = (
'cinder.tests.fake_driver.FakeLoggingVolumeDriver') {'v': 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
f['default_volume_type'] = self._vol_type_name 'g': configuration.SHARED_CONF_GROUP})
f['default_group_type'] = self._grp_type_name f['default_volume_type'] = {'v': self._vol_type_name}
f['default_group_type'] = {'v': self._grp_type_name}
return f return f
def test_group_replication(self): def test_group_replication(self):

View File

@ -16,6 +16,7 @@
from oslo_utils import uuidutils from oslo_utils import uuidutils
from cinder.tests.functional import functional_helpers from cinder.tests.functional import functional_helpers
from cinder.volume import configuration
class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): class GroupSnapshotsTest(functional_helpers._FunctionalTestBase):
@ -32,9 +33,10 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(GroupSnapshotsTest, self)._get_flags() f = super(GroupSnapshotsTest, self)._get_flags()
f['volume_driver'] = ( f['volume_driver'] = (
'cinder.tests.fake_driver.FakeLoggingVolumeDriver') {'v': 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
f['default_volume_type'] = self._vol_type_name 'g': configuration.SHARED_CONF_GROUP})
f['default_group_type'] = self._grp_type_name f['default_volume_type'] = {'v': self._vol_type_name}
f['default_group_type'] = {'v': self._grp_type_name}
return f return f
def test_get_group_snapshots_summary(self): def test_get_group_snapshots_summary(self):

View File

@ -16,6 +16,7 @@
from oslo_utils import uuidutils from oslo_utils import uuidutils
from cinder.tests.functional import functional_helpers from cinder.tests.functional import functional_helpers
from cinder.volume import configuration
class GroupsTest(functional_helpers._FunctionalTestBase): class GroupsTest(functional_helpers._FunctionalTestBase):
@ -35,9 +36,10 @@ class GroupsTest(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(GroupsTest, self)._get_flags() f = super(GroupsTest, self)._get_flags()
f['volume_driver'] = ( f['volume_driver'] = (
'cinder.tests.fake_driver.FakeLoggingVolumeDriver') {'v': 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
f['default_volume_type'] = self._vol_type_name 'g': configuration.SHARED_CONF_GROUP})
f['default_group_type'] = self._grp_type_name f['default_volume_type'] = {'v': self._vol_type_name}
f['default_group_type'] = {'v': self._grp_type_name}
return f return f
def test_get_groups_summary(self): def test_get_groups_summary(self):

View File

@ -17,6 +17,7 @@ import uuid
from cinder import quota from cinder import quota
from cinder.tests.functional.api import client from cinder.tests.functional.api import client
from cinder.tests.functional import functional_helpers from cinder.tests.functional import functional_helpers
from cinder.volume import configuration
class NestedQuotasTest(functional_helpers._FunctionalTestBase): class NestedQuotasTest(functional_helpers._FunctionalTestBase):
@ -51,9 +52,10 @@ class NestedQuotasTest(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(NestedQuotasTest, self)._get_flags() f = super(NestedQuotasTest, self)._get_flags()
f['volume_driver'] = \ f['volume_driver'] = (
'cinder.tests.fake_driver.FakeLoggingVolumeDriver' {'v': 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
f['default_volume_type'] = self._vol_type_name 'g': configuration.SHARED_CONF_GROUP})
f['default_volume_type'] = {'v': self._vol_type_name}
return f return f
# Currently we use 413 error for over quota # Currently we use 413 error for over quota

View File

@ -16,6 +16,7 @@
from oslo_utils import uuidutils from oslo_utils import uuidutils
from cinder.tests.functional import functional_helpers from cinder.tests.functional import functional_helpers
from cinder.volume import configuration
class VolumesTest(functional_helpers._FunctionalTestBase): class VolumesTest(functional_helpers._FunctionalTestBase):
@ -27,9 +28,10 @@ class VolumesTest(functional_helpers._FunctionalTestBase):
def _get_flags(self): def _get_flags(self):
f = super(VolumesTest, self)._get_flags() f = super(VolumesTest, self)._get_flags()
f['volume_driver'] = \ f['volume_driver'] = (
'cinder.tests.fake_driver.FakeLoggingVolumeDriver' {'v': 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
f['default_volume_type'] = self._vol_type_name 'g': configuration.SHARED_CONF_GROUP})
f['default_volume_type'] = {'v': self._vol_type_name}
return f return f
def test_get_volumes_summary(self): def test_get_volumes_summary(self):

View File

@ -18,11 +18,13 @@ import os
from oslo_config import cfg from oslo_config import cfg
from cinder.volume import configuration
CONF = cfg.CONF CONF = cfg.CONF
CONF.import_opt('policy_file', 'cinder.policy', group='oslo_policy') CONF.import_opt('policy_file', 'cinder.policy', group='oslo_policy')
CONF.import_opt('volume_driver', 'cinder.volume.manager') CONF.import_opt('volume_driver', 'cinder.volume.manager',
group=configuration.SHARED_CONF_GROUP)
CONF.import_opt('backup_driver', 'cinder.backup.manager') CONF.import_opt('backup_driver', 'cinder.backup.manager')
CONF.import_opt('api_class', 'cinder.keymgr', group='key_manager') CONF.import_opt('api_class', 'cinder.keymgr', group='key_manager')
CONF.import_opt('fixed_key', 'cinder.keymgr.conf_key_mgr', group='key_manager') CONF.import_opt('fixed_key', 'cinder.keymgr.conf_key_mgr', group='key_manager')
@ -34,7 +36,8 @@ def_vol_type = 'fake_vol_type'
def set_defaults(conf): def set_defaults(conf):
conf.set_default('default_volume_type', def_vol_type) conf.set_default('default_volume_type', def_vol_type)
conf.set_default('volume_driver', conf.set_default('volume_driver',
'cinder.tests.fake_driver.FakeLoggingVolumeDriver') 'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
group=configuration.SHARED_CONF_GROUP)
conf.set_default('iscsi_helper', 'fake') conf.set_default('iscsi_helper', 'fake')
conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake') conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake')
conf.set_default('connection', 'sqlite://', group='database') conf.set_default('connection', 'sqlite://', group='database')

View File

@ -18,6 +18,8 @@ import six
from cinder import test from cinder import test
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration as conf
from cinder.volume.drivers.dell_emc.scaleio import driver
class CustomResponseMode(object): class CustomResponseMode(object):
@ -115,11 +117,37 @@ class TestScaleIODriver(test.TestCase):
``MockHTTPSResponse``'s instead. ``MockHTTPSResponse``'s instead.
""" """
super(TestScaleIODriver, self).setUp() super(TestScaleIODriver, self).setUp()
self.driver = mocks.ScaleIODriver() self.configuration = conf.Configuration(driver.scaleio_opts,
conf.SHARED_CONF_GROUP)
self._set_overrides()
self.driver = mocks.ScaleIODriver(configuration=self.configuration)
self.mock_object(requests, 'get', self.do_request) self.mock_object(requests, 'get', self.do_request)
self.mock_object(requests, 'post', self.do_request) self.mock_object(requests, 'post', self.do_request)
def _set_overrides(self):
# Override the defaults to fake values
self.override_config('san_ip', override='127.0.0.1',
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_rest_server_port', override='8888',
group=conf.SHARED_CONF_GROUP)
self.override_config('san_login', override='test',
group=conf.SHARED_CONF_GROUP)
self.override_config('san_password', override='pass',
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_storage_pool_id', override='test_pool',
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_protection_domain_id',
override='test_domain',
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_storage_pools',
override='test_domain:test_pool',
group=conf.SHARED_CONF_GROUP)
self.override_config('max_over_subscription_ratio',
override=5.0, group=conf.SHARED_CONF_GROUP)
self.override_config('sio_server_api_version',
override='2.0.0', group=conf.SHARED_CONF_GROUP)
def do_request(self, url, *args, **kwargs): def do_request(self, url, *args, **kwargs):
"""Do a fake GET/POST API request. """Do a fake GET/POST API request.

View File

@ -16,47 +16,18 @@ import json
import requests import requests
import six import six
from cinder.volume import configuration as conf
from cinder.volume.drivers.dell_emc.scaleio import driver
from oslo_config import cfg from oslo_config import cfg
from cinder.volume.drivers.dell_emc.scaleio import driver
CONF = cfg.CONF
class ScaleIODriver(driver.ScaleIODriver): class ScaleIODriver(driver.ScaleIODriver):
"""Mock ScaleIO Driver class. """Mock ScaleIO Driver class.
Provides some fake configuration options Provides some fake configuration options
""" """
def __init__(self, *args, **kwargs):
configuration = conf.Configuration(
[
cfg.StrOpt('fake'),
],
None
)
# Override the defaults to fake values
configuration.set_override('san_ip', override='127.0.0.1')
configuration.set_override('sio_rest_server_port', override='8888')
configuration.set_override('san_login', override='test')
configuration.set_override('san_password', override='pass')
configuration.set_override('sio_storage_pool_id', override='test_pool')
configuration.set_override('sio_protection_domain_id',
override='test_domain')
configuration.set_override('sio_storage_pools',
override='test_domain:test_pool')
configuration.set_override('max_over_subscription_ratio',
override=5.0)
configuration.set_override('sio_server_api_version',
override='2.0.0')
if 'san_thin_provision' in kwargs:
configuration.set_override(
'san_thin_provision',
override=kwargs['san_thin_provision'])
super(ScaleIODriver, self).__init__(configuration=configuration,
*args,
**kwargs)
def local_path(self, volume): def local_path(self, volume):
pass pass

View File

@ -20,6 +20,7 @@ from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit.fake_snapshot import fake_snapshot_obj from cinder.tests.unit.fake_snapshot import fake_snapshot_obj
from cinder.tests.unit.volume.drivers.dell_emc import scaleio from cinder.tests.unit.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestDeleteSnapShot(scaleio.TestScaleIODriver): class TestDeleteSnapShot(scaleio.TestScaleIODriver):
@ -88,8 +89,7 @@ class TestDeleteSnapShot(scaleio.TestScaleIODriver):
def test_delete_snapshot(self): def test_delete_snapshot(self):
"""Setting the unmap volume before delete flag for tests """ """Setting the unmap volume before delete flag for tests """
self.driver.configuration.set_override( self.override_config('sio_unmap_volume_before_deletion', True,
'sio_unmap_volume_before_deletion', configuration.SHARED_CONF_GROUP)
override=True)
self.set_https_response_mode(self.RESPONSE_MODE.Valid) self.set_https_response_mode(self.RESPONSE_MODE.Valid)
self.driver.delete_snapshot(self.snapshot) self.driver.delete_snapshot(self.snapshot)

View File

@ -20,6 +20,7 @@ from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit import fake_volume from cinder.tests.unit import fake_volume
from cinder.tests.unit.volume.drivers.dell_emc import scaleio from cinder.tests.unit.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestDeleteVolume(scaleio.TestScaleIODriver): class TestDeleteVolume(scaleio.TestScaleIODriver):
@ -76,7 +77,6 @@ class TestDeleteVolume(scaleio.TestScaleIODriver):
def test_delete_volume(self): def test_delete_volume(self):
"""Setting the unmap volume before delete flag for tests """ """Setting the unmap volume before delete flag for tests """
self.driver.configuration.set_override( self.override_config('sio_unmap_volume_before_deletion', True,
'sio_unmap_volume_before_deletion', configuration.SHARED_CONF_GROUP)
override=True)
self.driver.delete_volume(self.volume) self.driver.delete_volume(self.volume)

View File

@ -20,6 +20,7 @@ from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit.fake_volume import fake_volume_obj from cinder.tests.unit.fake_volume import fake_volume_obj
from cinder.tests.unit.volume.drivers.dell_emc import scaleio from cinder.tests.unit.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestExtendVolume(scaleio.TestScaleIODriver): class TestExtendVolume(scaleio.TestScaleIODriver):
@ -91,14 +92,14 @@ class TestExtendVolume(scaleio.TestScaleIODriver):
self.NEW_SIZE) self.NEW_SIZE)
def test_extend_volume_bad_size_no_round(self): def test_extend_volume_bad_size_no_round(self):
self.driver.configuration.set_override('sio_round_volume_capacity', self.override_config('sio_round_volume_capacity', False,
override=False) configuration.SHARED_CONF_GROUP)
self.set_https_response_mode(self.RESPONSE_MODE.Valid) self.set_https_response_mode(self.RESPONSE_MODE.Valid)
self.driver.extend_volume(self.volume, self.BAD_SIZE) self.driver.extend_volume(self.volume, self.BAD_SIZE)
def test_extend_volume_bad_size_round(self): def test_extend_volume_bad_size_round(self):
self.driver.configuration.set_override('sio_round_volume_capacity', self.override_config('sio_round_volume_capacity', True,
override=True) configuration.SHARED_CONF_GROUP)
self.driver.extend_volume(self.volume, self.BAD_SIZE) self.driver.extend_volume(self.volume, self.BAD_SIZE)
def test_extend_volume(self): def test_extend_volume(self):

View File

@ -23,6 +23,7 @@ from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit import fake_volume from cinder.tests.unit import fake_volume
from cinder.tests.unit.volume.drivers.dell_emc import scaleio from cinder.tests.unit.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
@ddt.ddt @ddt.ddt
@ -133,8 +134,8 @@ class TestMisc(scaleio.TestScaleIODriver):
self.driver._check_volume_size(1) self.driver._check_volume_size(1)
def test_volume_size_round_false(self): def test_volume_size_round_false(self):
self.driver.configuration.set_override('sio_round_volume_capacity', self.override_config('sio_round_volume_capacity', False,
override=False) configuration.SHARED_CONF_GROUP)
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver._check_volume_size, 1) self.driver._check_volume_size, 1)
@ -268,8 +269,9 @@ class TestMisc(scaleio.TestScaleIODriver):
@ddt.unpack @ddt.unpack
def test_default_provisioning_type_thin(self, config_provisioning_type, def test_default_provisioning_type_thin(self, config_provisioning_type,
expected_provisioning_type): expected_provisioning_type):
self.driver = mocks.ScaleIODriver( self.override_config('san_thin_provision', config_provisioning_type,
san_thin_provision=config_provisioning_type) configuration.SHARED_CONF_GROUP)
self.driver = mocks.ScaleIODriver(configuration=self.configuration)
empty_storage_type = {} empty_storage_type = {}
self.assertEqual( self.assertEqual(
expected_provisioning_type, expected_provisioning_type,

View File

@ -129,6 +129,8 @@ class HNASNFSDriverTest(test.TestCase):
self.configuration.hds_hnas_nfs_config_file = 'fake_config.xml' self.configuration.hds_hnas_nfs_config_file = 'fake_config.xml'
self.configuration.nfs_shares_config = 'fake_nfs_share.xml' self.configuration.nfs_shares_config = 'fake_nfs_share.xml'
self.configuration.num_shell_tries = 2 self.configuration.num_shell_tries = 2
self.configuration.nfs_mount_point_base = '%state_path/mnt'
self.configuration.nfs_mount_options = None
self.driver = nfs.HNASNFSDriver(configuration=self.configuration) self.driver = nfs.HNASNFSDriver(configuration=self.configuration)

View File

@ -151,15 +151,23 @@ class HNASUtilsTest(test.TestCase):
def setUp(self): def setUp(self):
super(HNASUtilsTest, self).setUp() super(HNASUtilsTest, self).setUp()
self.fake_conf = conf.Configuration(hnas_utils.CONF) self.fake_conf = conf.Configuration(hnas_utils.drivers_common_opts,
conf.SHARED_CONF_GROUP)
self.override_config('hnas_username', 'supervisor') self.override_config('hnas_username', 'supervisor',
self.override_config('hnas_password', 'supervisor') conf.SHARED_CONF_GROUP)
self.override_config('hnas_mgmt_ip0', '172.24.44.15') self.override_config('hnas_password', 'supervisor',
self.override_config('hnas_svc0_pool_name', 'default') conf.SHARED_CONF_GROUP)
self.override_config('hnas_svc0_hdp', 'easy-stack') self.override_config('hnas_mgmt_ip0', '172.24.44.15',
self.override_config('hnas_svc1_pool_name', 'FS-CinderDev1') conf.SHARED_CONF_GROUP)
self.override_config('hnas_svc1_hdp', 'silver') self.override_config('hnas_svc0_pool_name', 'default',
conf.SHARED_CONF_GROUP)
self.override_config('hnas_svc0_hdp', 'easy-stack',
conf.SHARED_CONF_GROUP)
self.override_config('hnas_svc1_pool_name', 'FS-CinderDev1',
conf.SHARED_CONF_GROUP)
self.override_config('hnas_svc1_hdp', 'silver',
conf.SHARED_CONF_GROUP)
self.context = context.get_admin_context() self.context = context.get_admin_context()
self.volume = fake_volume.fake_volume_obj(self.context, **_VOLUME) self.volume = fake_volume.fake_volume_obj(self.context, **_VOLUME)
@ -281,9 +289,9 @@ class HNASUtilsTest(test.TestCase):
self.assertEqual(config_from_cinder_conf, out) self.assertEqual(config_from_cinder_conf, out)
def test_read_cinder_conf_break(self): def test_read_cinder_conf_break(self):
self.override_config('hnas_username', None) self.override_config('hnas_username', None, conf.SHARED_CONF_GROUP)
self.override_config('hnas_password', None) self.override_config('hnas_password', None, conf.SHARED_CONF_GROUP)
self.override_config('hnas_mgmt_ip0', None) self.override_config('hnas_mgmt_ip0', None, conf.SHARED_CONF_GROUP)
out = hnas_utils.read_cinder_conf(self.fake_conf) out = hnas_utils.read_cinder_conf(self.fake_conf)
self.assertIsNone(out) self.assertIsNone(out)
@ -291,7 +299,7 @@ class HNASUtilsTest(test.TestCase):
'hnas_mgmt_ip0', 'hnas_svc0_pool_name', 'hnas_mgmt_ip0', 'hnas_svc0_pool_name',
'hnas_svc0_hdp', ) 'hnas_svc0_hdp', )
def test_init_invalid_conf_parameters(self, attr_name): def test_init_invalid_conf_parameters(self, attr_name):
self.override_config(attr_name, None) self.override_config(attr_name, None, conf.SHARED_CONF_GROUP)
self.assertRaises(exception.InvalidParameterValue, self.assertRaises(exception.InvalidParameterValue,
hnas_utils.read_cinder_conf, self.fake_conf) hnas_utils.read_cinder_conf, self.fake_conf)

View File

@ -27,6 +27,7 @@ import re
import time import time
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils
from oslo_utils import units from oslo_utils import units
import six import six
@ -55,6 +56,8 @@ from cinder.volume import volume_types
SVC_POOLS = ['openstack', 'openstack1'] SVC_POOLS = ['openstack', 'openstack1']
CONF = cfg.CONF
def _get_test_pool(get_all=False): def _get_test_pool(get_all=False):
if get_all: if get_all:
@ -2240,7 +2243,7 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
self.USESIM = True self.USESIM = True
if self.USESIM: if self.USESIM:
self.iscsi_driver = StorwizeSVCISCSIFakeDriver( self.iscsi_driver = StorwizeSVCISCSIFakeDriver(
configuration=conf.Configuration(None)) configuration=conf.Configuration([], conf.SHARED_CONF_GROUP))
self._def_flags = {'san_ip': 'hostname', self._def_flags = {'san_ip': 'hostname',
'san_login': 'user', 'san_login': 'user',
'san_password': 'pass', 'san_password': 'pass',
@ -2265,7 +2268,7 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
self._reset_flags() self._reset_flags()
self.ctxt = context.get_admin_context() self.ctxt = context.get_admin_context()
db_driver = self.iscsi_driver.configuration.db_driver db_driver = CONF.db_driver
self.db = importutils.import_module(db_driver) self.db = importutils.import_module(db_driver)
self.iscsi_driver.db = self.db self.iscsi_driver.db = self.db
self.iscsi_driver.do_setup(None) self.iscsi_driver.do_setup(None)
@ -2274,10 +2277,10 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
def _set_flag(self, flag, value): def _set_flag(self, flag, value):
group = self.iscsi_driver.configuration.config_group group = self.iscsi_driver.configuration.config_group
self.iscsi_driver.configuration.set_override(flag, value, group) self.override_config(flag, value, group)
def _reset_flags(self): def _reset_flags(self):
self.iscsi_driver.configuration.local_conf.reset() CONF.reset()
for k, v in self._def_flags.items(): for k, v in self._def_flags.items():
self._set_flag(k, v) self._set_flag(k, v)
@ -3436,7 +3439,8 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
'storwize_svc_flashcopy_timeout': 20, 'storwize_svc_flashcopy_timeout': 20,
'storwize_svc_flashcopy_rate': 49, 'storwize_svc_flashcopy_rate': 49,
'storwize_svc_allow_tenant_qos': True} 'storwize_svc_allow_tenant_qos': True}
config = conf.Configuration(None) config = conf.Configuration(storwize_svc_common.storwize_svc_opts,
conf.SHARED_CONF_GROUP)
# Override any configs that may get set in __init__ # Override any configs that may get set in __init__
self._reset_flags(config) self._reset_flags(config)
self.driver = StorwizeSVCISCSIFakeDriver( self.driver = StorwizeSVCISCSIFakeDriver(
@ -3460,7 +3464,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
else: else:
self._reset_flags() self._reset_flags()
self.ctxt = context.get_admin_context() self.ctxt = context.get_admin_context()
db_driver = self.driver.configuration.db_driver db_driver = CONF.db_driver
self.db = importutils.import_module(db_driver) self.db = importutils.import_module(db_driver)
self.driver.db = self.db self.driver.db = self.db
self.driver.do_setup(None) self.driver.do_setup(None)
@ -3474,12 +3478,12 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
if not configuration: if not configuration:
configuration = self.driver.configuration configuration = self.driver.configuration
group = configuration.config_group group = configuration.config_group
configuration.set_override(flag, value, group) self.override_config(flag, value, group)
def _reset_flags(self, configuration=None): def _reset_flags(self, configuration=None):
if not configuration: if not configuration:
configuration = self.driver.configuration configuration = self.driver.configuration
configuration.local_conf.reset() CONF.reset()
for k, v in self._def_flags.items(): for k, v in self._def_flags.items():
self._set_flag(k, v, configuration) self._set_flag(k, v, configuration)
@ -6183,7 +6187,6 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
self.driver.configuration.set_override(flag, value, group) self.driver.configuration.set_override(flag, value, group)
def _reset_flags(self): def _reset_flags(self):
self.driver.configuration.local_conf.reset()
for k, v in self._def_flags.items(): for k, v in self._def_flags.items():
self._set_flag(k, v) self._set_flag(k, v)
self.driver.configuration.set_override('replication_device', self.driver.configuration.set_override('replication_device',
@ -6604,7 +6607,8 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
self.assertEqual({'_name_id': None}, model_update) self.assertEqual({'_name_id': None}, model_update)
rename_vdisk.reset_mock() rename_vdisk.reset_mock()
rename_vdisk.side_effect = exception.VolumeBackendAPIException rename_vdisk.side_effect = exception.VolumeBackendAPIException(
data='foo')
model_update = self.driver.update_migrated_volume(self.ctxt, volume, model_update = self.driver.update_migrated_volume(self.ctxt, volume,
backend_volume, backend_volume,
'available') 'available')

View File

@ -37,7 +37,8 @@ class InfortrendTestCass(test.TestCase):
super(InfortrendTestCass, self).setUp() super(InfortrendTestCass, self).setUp()
self.cli_data = test_infortrend_cli.InfortrendCLITestData() self.cli_data = test_infortrend_cli.InfortrendCLITestData()
self.configuration = configuration.Configuration(None) self.configuration = configuration.Configuration(
[], config_group=configuration.SHARED_CONF_GROUP)
self.configuration.append_config_values = mock.Mock(return_value=0) self.configuration.append_config_values = mock.Mock(return_value=0)
self.configuration.safe_get = self._fake_safe_get self.configuration.safe_get = self._fake_safe_get

View File

@ -73,6 +73,7 @@ class TestNexentaNfsDriver(test.TestCase):
self.cfg.nexenta_dataset_dedup = 'off' self.cfg.nexenta_dataset_dedup = 'off'
self.cfg.nfs_mount_point_base = '/mnt/test' self.cfg.nfs_mount_point_base = '/mnt/test'
self.cfg.nfs_mount_attempts = 3 self.cfg.nfs_mount_attempts = 3
self.cfg.nfs_mount_options = None
self.cfg.nas_mount_options = 'vers=4' self.cfg.nas_mount_options = 'vers=4'
self.cfg.reserved_percentage = 20 self.cfg.reserved_percentage = 20
self.cfg.nexenta_use_https = False self.cfg.nexenta_use_https = False

View File

@ -66,7 +66,8 @@ class GPFSDriverTestCase(test.TestCase):
os.mkdir(self.images_dir) os.mkdir(self.images_dir)
self.image_id = '70a599e0-31e7-49b7-b260-868f441e862b' self.image_id = '70a599e0-31e7-49b7-b260-868f441e862b'
self.driver = gpfs.GPFSDriver(configuration=conf.Configuration(None)) self.driver = gpfs.GPFSDriver(
configuration=conf.Configuration([], conf.SHARED_CONF_GROUP))
self.driver.gpfs_execute = self._execute_wrapper self.driver.gpfs_execute = self._execute_wrapper
exec_patcher = mock.patch.object(self.driver, '_execute', exec_patcher = mock.patch.object(self.driver, '_execute',
self._execute_wrapper) self._execute_wrapper)
@ -77,8 +78,10 @@ class GPFSDriverTestCase(test.TestCase):
self.driver._storage_pool = 'system' self.driver._storage_pool = 'system'
self.driver._encryption_state = 'yes' self.driver._encryption_state = 'yes'
self.flags(volume_driver=self.driver_name, self.override_config('volume_driver', self.driver_name,
gpfs_mount_point_base=self.volumes_path) conf.SHARED_CONF_GROUP)
self.override_config('gpfs_mount_point_base', self.volumes_path,
conf.SHARED_CONF_GROUP)
self.context = context.get_admin_context() self.context = context.get_admin_context()
self.context.user_id = 'fake' self.context.user_id = 'fake'
@ -533,104 +536,91 @@ class GPFSDriverTestCase(test.TestCase):
# fail configuration.gpfs_mount_point_base is None # fail configuration.gpfs_mount_point_base is None
org_value = self.driver.configuration.gpfs_mount_point_base org_value = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name, gpfs_mount_point_base=None) self.override_config('gpfs_mount_point_base', None,
conf.SHARED_CONF_GROUP)
mock_get_gpfs_fs_rel_lev.return_value = (fake_fs, fake_fs_release) mock_get_gpfs_fs_rel_lev.return_value = (fake_fs, fake_fs_release)
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_mount_point_base', org_value,
gpfs_mount_point_base=org_value) conf.SHARED_CONF_GROUP)
# fail configuration.gpfs_images_share_mode and # fail configuration.gpfs_images_share_mode and
# configuration.gpfs_images_dir is None # configuration.gpfs_images_dir is None
org_value_share_mode = self.driver.configuration.gpfs_images_share_mode self.override_config('gpfs_images_share_mode', 'copy',
self.flags(volume_driver=self.driver_name, conf.SHARED_CONF_GROUP)
gpfs_images_share_mode='copy') self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
org_value_dir = CONF.gpfs_images_dir org_value_dir = self.driver.configuration.gpfs_images_dir
CONF.gpfs_images_dir = None
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_dir', org_value_dir,
gpfs_images_share_mode=org_value_share_mode) conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = org_value_dir
# fail configuration.gpfs_images_share_mode == 'copy_on_write' and not # fail configuration.gpfs_images_share_mode == 'copy_on_write' and not
# _same_filesystem(configuration.gpfs_mount_point_base, # _same_filesystem(configuration.gpfs_mount_point_base,
# configuration.gpfs_images_dir) # configuration.gpfs_images_dir)
org_value = self.driver.configuration.gpfs_images_share_mode self.override_config('gpfs_images_share_mode', 'copy_on_write',
self.flags(volume_driver=self.driver_name, conf.SHARED_CONF_GROUP)
gpfs_images_share_mode='copy_on_write')
with mock.patch('cinder.volume.drivers.ibm.gpfs._same_filesystem', with mock.patch('cinder.volume.drivers.ibm.gpfs._same_filesystem',
return_value=False): return_value=False):
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value)
# fail self.configuration.gpfs_images_share_mode == 'copy_on_write' and # fail self.configuration.gpfs_images_share_mode == 'copy_on_write' and
# not self._is_same_fileset(self.configuration.gpfs_mount_point_base, # not self._is_same_fileset(self.configuration.gpfs_mount_point_base,
# self.configuration.gpfs_images_dir) # self.configuration.gpfs_images_dir)
org_value = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy_on_write')
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_is_same_fileset', return_value=False): '_is_same_fileset', return_value=False):
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value)
# fail directory is None # fail directory is None
org_value_share_mode = self.driver.configuration.gpfs_images_share_mode self.override_config('gpfs_images_share_mode', None,
self.flags(volume_driver=self.driver_name, conf.SHARED_CONF_GROUP)
gpfs_images_share_mode=None) org_value_dir = self.driver.configuration.gpfs_images_dir
org_value_dir = CONF.gpfs_images_dir self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = None
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level', '_get_gpfs_cluster_release_level',
return_value=fake_cluster_release): return_value=fake_cluster_release):
self.driver.check_for_setup_error() self.driver.check_for_setup_error()
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_dir', org_value_dir,
gpfs_images_share_mode=org_value_share_mode) conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = org_value_dir
# fail directory.startswith('/') # fail directory.startswith('/')
org_value_mount = self.driver.configuration.gpfs_mount_point_base org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_mount_point_base', '_' + self.volumes_path,
gpfs_mount_point_base='_' + self.volumes_path) conf.SHARED_CONF_GROUP)
org_value_dir = CONF.gpfs_images_dir self.override_config('gpfs_images_share_mode', None,
CONF.gpfs_images_dir = None conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level', '_get_gpfs_cluster_release_level',
return_value=fake_cluster_release): return_value=fake_cluster_release):
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_mount_point_base', org_value_mount,
gpfs_mount_point_base=org_value_mount) conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = org_value_dir
# fail os.path.isdir(directory) # fail os.path.isdir(directory)
org_value_mount = self.driver.configuration.gpfs_mount_point_base org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_mount_point_base', self.volumes_path + '_',
gpfs_mount_point_base=self.volumes_path + '_') conf.SHARED_CONF_GROUP)
org_value_dir = CONF.gpfs_images_dir org_value_dir = self.driver.configuration.gpfs_images_dir
CONF.gpfs_images_dir = None self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level', '_get_gpfs_cluster_release_level',
return_value=fake_cluster_release): return_value=fake_cluster_release):
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_mount_point_base', org_value_mount,
gpfs_mount_point_base=org_value_mount) conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = org_value_dir self.override_config('gpfs_images_dir', org_value_dir,
conf.SHARED_CONF_GROUP)
# fail not cluster release level >= GPFS_CLONE_MIN_RELEASE # fail not cluster release level >= GPFS_CLONE_MIN_RELEASE
org_fake_cluster_release = fake_cluster_release org_fake_cluster_release = fake_cluster_release
fake_cluster_release = 1105 fake_cluster_release = 1105
org_value_mount = self.driver.configuration.gpfs_mount_point_base self.override_config('gpfs_mount_point_base', self.volumes_path,
self.flags(volume_driver=self.driver_name, conf.SHARED_CONF_GROUP)
gpfs_mount_point_base=self.volumes_path) self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level', '_get_gpfs_cluster_release_level',
return_value=fake_cluster_release): return_value=fake_cluster_release):
@ -644,11 +634,9 @@ class GPFSDriverTestCase(test.TestCase):
# fail not fs release level >= GPFS_CLONE_MIN_RELEASE # fail not fs release level >= GPFS_CLONE_MIN_RELEASE
org_fake_fs_release = fake_fs_release org_fake_fs_release = fake_fs_release
fake_fs_release = 1105 fake_fs_release = 1105
org_value_mount = self.driver.configuration.gpfs_mount_point_base self.override_config('gpfs_mount_point_base', self.volumes_path,
self.flags(volume_driver=self.driver_name, conf.SHARED_CONF_GROUP)
gpfs_mount_point_base=self.volumes_path) self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level', '_get_gpfs_cluster_release_level',
return_value=fake_cluster_release): return_value=fake_cluster_release):
@ -657,9 +645,6 @@ class GPFSDriverTestCase(test.TestCase):
return_value=(fake_fs, fake_fs_release)): return_value=(fake_fs, fake_fs_release)):
self.assertRaises(exception.VolumeBackendAPIException, self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error) self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=org_value_mount)
CONF.gpfs_images_dir = org_value_dir
fake_fs_release = org_fake_fs_release fake_fs_release = org_fake_fs_release
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
@ -698,20 +683,21 @@ class GPFSDriverTestCase(test.TestCase):
def test_set_volume_attributes_no_attributes(self, mock_change_attributes): def test_set_volume_attributes_no_attributes(self, mock_change_attributes):
metadata = {} metadata = {}
org_value = self.driver.configuration.gpfs_storage_pool org_value = self.driver.configuration.gpfs_storage_pool
self.flags(volume_driver=self.driver_name, gpfs_storage_pool='system') self.override_config('gpfs_storage_pool', 'system',
conf.SHARED_CONF_GROUP)
self.driver._set_volume_attributes('', '', metadata) self.driver._set_volume_attributes('', '', metadata)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_storage_pool', org_value,
gpfs_storage_pool=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_gpfs_change_attributes') '_gpfs_change_attributes')
def test_set_volume_attributes_no_options(self, mock_change_attributes): def test_set_volume_attributes_no_options(self, mock_change_attributes):
metadata = {} metadata = {}
org_value = self.driver.configuration.gpfs_storage_pool org_value = self.driver.configuration.gpfs_storage_pool
self.flags(volume_driver=self.driver_name, gpfs_storage_pool='') self.override_config('gpfs_storage_pool', '', conf.SHARED_CONF_GROUP)
self.driver._set_volume_attributes('', '', metadata) self.driver._set_volume_attributes('', '', metadata)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_storage_pool', org_value,
gpfs_storage_pool=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -739,10 +725,11 @@ class GPFSDriverTestCase(test.TestCase):
value['value'] = 'test' value['value'] = 'test'
org_value = self.driver.configuration.gpfs_sparse_volumes org_value = self.driver.configuration.gpfs_sparse_volumes
self.flags(volume_driver=self.driver_name, gpfs_sparse_volumes=False) self.override_config('gpfs_sparse_volumes', False,
conf.SHARED_CONF_GROUP)
self.driver.create_volume(volume) self.driver.create_volume(volume)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_sparse_volumes', org_value,
gpfs_sparse_volumes=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -770,10 +757,11 @@ class GPFSDriverTestCase(test.TestCase):
value['value'] = 'test' value['value'] = 'test'
org_value = self.driver.configuration.gpfs_sparse_volumes org_value = self.driver.configuration.gpfs_sparse_volumes
self.flags(volume_driver=self.driver_name, gpfs_sparse_volumes=True) self.override_config('gpfs_sparse_volumes', True,
conf.SHARED_CONF_GROUP)
self.driver.create_volume(volume) self.driver.create_volume(volume)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_sparse_volumes', org_value,
gpfs_sparse_volumes=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -803,12 +791,13 @@ class GPFSDriverTestCase(test.TestCase):
metadata = {'fake_key': 'fake_value'} metadata = {'fake_key': 'fake_value'}
org_value = self.driver.configuration.gpfs_sparse_volumes org_value = self.driver.configuration.gpfs_sparse_volumes
self.flags(volume_driver=self.driver_name, gpfs_sparse_volumes=False) self.override_config('gpfs_sparse_volumes', True,
conf.SHARED_CONF_GROUP)
self.driver.create_volume(volume) self.driver.create_volume(volume)
self.assertTrue(self.driver._set_volume_attributes(volume, 'test', self.assertTrue(self.driver._set_volume_attributes(volume, 'test',
metadata)) metadata))
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_sparse_volumes', org_value,
gpfs_sparse_volumes=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file') '_resize_volume_file')
@ -991,48 +980,48 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
def test_gpfs_redirect_ok(self, mock_exec): def test_gpfs_redirect_ok(self, mock_exec):
org_value = self.driver.configuration.gpfs_max_clone_depth org_value = self.driver.configuration.gpfs_max_clone_depth
self.flags(volume_driver=self.driver_name, gpfs_max_clone_depth=1) self.override_config('gpfs_max_clone_depth', 1, conf.SHARED_CONF_GROUP)
mock_exec.side_effect = [('Parent Depth Parent inode File name\n' mock_exec.side_effect = [('Parent Depth Parent inode File name\n'
'------ ----- -------------- ---------\n' '------ ----- -------------- ---------\n'
' no 2 148488 ' ' no 2 148488 '
'/gpfs0/test.txt', ''), '/gpfs0/test.txt', ''),
('', '')] ('', '')]
self.assertTrue(self.driver._gpfs_redirect('')) self.assertTrue(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name, gpfs_max_clone_depth=1) self.override_config('gpfs_max_clone_depth', 1, conf.SHARED_CONF_GROUP)
mock_exec.side_effect = [('Parent Depth Parent inode File name\n' mock_exec.side_effect = [('Parent Depth Parent inode File name\n'
'------ ----- -------------- ---------\n' '------ ----- -------------- ---------\n'
' no 1 148488 ' ' no 1 148488 '
'/gpfs0/test.txt', ''), '/gpfs0/test.txt', ''),
('', '')] ('', '')]
self.assertFalse(self.driver._gpfs_redirect('')) self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_max_clone_depth', org_value,
gpfs_max_clone_depth=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
def test_gpfs_redirect_fail_depth(self, mock_exec): def test_gpfs_redirect_fail_depth(self, mock_exec):
org_value = self.driver.configuration.gpfs_max_clone_depth org_value = self.driver.configuration.gpfs_max_clone_depth
self.flags(volume_driver=self.driver_name, gpfs_max_clone_depth=0) self.override_config('gpfs_max_clone_depth', 0, conf.SHARED_CONF_GROUP)
mock_exec.side_effect = [('Parent Depth Parent inode File name\n' mock_exec.side_effect = [('Parent Depth Parent inode File name\n'
'------ ----- -------------- ---------\n' '------ ----- -------------- ---------\n'
' no 2 148488 ' ' no 2 148488 '
'/gpfs0/test.txt', ''), '/gpfs0/test.txt', ''),
('', '')] ('', '')]
self.assertFalse(self.driver._gpfs_redirect('')) self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_max_clone_depth', org_value,
gpfs_max_clone_depth=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
def test_gpfs_redirect_fail_match(self, mock_exec): def test_gpfs_redirect_fail_match(self, mock_exec):
org_value = self.driver.configuration.gpfs_max_clone_depth org_value = self.driver.configuration.gpfs_max_clone_depth
self.flags(volume_driver=self.driver_name, gpfs_max_clone_depth=1) self.override_config('gpfs_max_clone_depth', 1, conf.SHARED_CONF_GROUP)
mock_exec.side_effect = [('Parent Depth Parent inode File name\n' mock_exec.side_effect = [('Parent Depth Parent inode File name\n'
'------ ----- -------------- ---------\n' '------ ----- -------------- ---------\n'
' 148488 ' ' 148488 '
'/gpfs0/test.txt', ''), '/gpfs0/test.txt', ''),
('', '')] ('', '')]
self.assertFalse(self.driver._gpfs_redirect('')) self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_max_clone_depth', org_value,
gpfs_max_clone_depth=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._create_gpfs_snap') @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._create_gpfs_snap')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._create_gpfs_copy') @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._create_gpfs_copy')
@ -1085,16 +1074,11 @@ class GPFSDriverTestCase(test.TestCase):
mock_set_rw_permission, mock_set_rw_permission,
mock_gpfs_redirect, mock_gpfs_redirect,
mock_vol_get_by_id): mock_vol_get_by_id):
org_value = self.driver.configuration.gpfs_mount_point_base
mock_get_snapshot_path.return_value = "/tmp/fakepath" mock_get_snapshot_path.return_value = "/tmp/fakepath"
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=self.volumes_path)
vol = self._fake_volume() vol = self._fake_volume()
mock_vol_get_by_id.return_value = vol mock_vol_get_by_id.return_value = vol
self.driver.create_snapshot(self._fake_snapshot()) self.driver.create_snapshot(self._fake_snapshot())
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=org_value)
@mock.patch('cinder.utils.execute') @mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -1184,8 +1168,10 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._is_gpfs_path') @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._is_gpfs_path')
def test_is_cloneable_ok(self, mock_is_gpfs_path): def test_is_cloneable_ok(self, mock_is_gpfs_path):
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', 'copy',
gpfs_images_share_mode='copy') conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_dir', self.images_dir,
conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = self.images_dir CONF.gpfs_images_dir = self.images_dir
mock_is_gpfs_path.return_value = None mock_is_gpfs_path.return_value = None
self.assertEqual((True, None, os.path.join(CONF.gpfs_images_dir, self.assertEqual((True, None, os.path.join(CONF.gpfs_images_dir,
@ -1194,8 +1180,8 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._is_gpfs_path') @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._is_gpfs_path')
def test_is_cloneable_fail_path(self, mock_is_gpfs_path): def test_is_cloneable_fail_path(self, mock_is_gpfs_path):
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', 'copy',
gpfs_images_share_mode='copy') conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = self.images_dir CONF.gpfs_images_dir = self.images_dir
mock_is_gpfs_path.side_effect = ( mock_is_gpfs_path.side_effect = (
processutils.ProcessExecutionError(stdout='test', stderr='test')) processutils.ProcessExecutionError(stdout='test', stderr='test'))
@ -1275,14 +1261,14 @@ class GPFSDriverTestCase(test.TestCase):
mock_qemu_img_info.return_value = self._fake_qemu_raw_image_info('') mock_qemu_img_info.return_value = self._fake_qemu_raw_image_info('')
volume = self._fake_volume() volume = self._fake_volume()
org_value = self.driver.configuration.gpfs_images_share_mode org_value = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', 'copy_on_write',
gpfs_images_share_mode='copy_on_write') conf.SHARED_CONF_GROUP)
self.assertEqual(({'provider_location': None}, True), self.assertEqual(({'provider_location': None}, True),
self.driver._clone_image(volume, '', 1)) self.driver._clone_image(volume, '', 1))
mock_create_gpfs_snap.assert_called_once_with(self.images_dir) mock_create_gpfs_snap.assert_called_once_with(self.images_dir)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', org_value,
gpfs_images_share_mode=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file') '_resize_volume_file')
@ -1311,15 +1297,15 @@ class GPFSDriverTestCase(test.TestCase):
volume = self._fake_volume() volume = self._fake_volume()
org_value = self.driver.configuration.gpfs_images_share_mode org_value = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', 'copy',
gpfs_images_share_mode='copy') conf.SHARED_CONF_GROUP)
self.assertEqual(({'provider_location': None}, True), self.assertEqual(({'provider_location': None}, True),
self.driver._clone_image(volume, '', 1)) self.driver._clone_image(volume, '', 1))
mock_copyfile.assert_called_once_with(self.images_dir, mock_copyfile.assert_called_once_with(self.images_dir,
self.volumes_path) self.volumes_path)
self.flags(volume_driver=self.driver_name, self.override_config('gpfs_images_share_mode', org_value,
gpfs_images_share_mode=org_value) conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.' @mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file') '_resize_volume_file')

View File

@ -689,6 +689,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
def test_revert_snapshot(self): def test_revert_snapshot(self):
self._setup_stubs_for_manage_existing() self._setup_stubs_for_manage_existing()
self.configuration.lvm_type = 'auto'
fake_volume = tests_utils.create_volume(self.context, fake_volume = tests_utils.create_volume(self.context,
display_name='fake_volume') display_name='fake_volume')
fake_snapshot = tests_utils.create_snapshot( fake_snapshot = tests_utils.create_snapshot(

View File

@ -924,6 +924,8 @@ class TestZFSSANFSDriver(test.TestCase):
self.configuration.zfssa_enable_local_cache = True self.configuration.zfssa_enable_local_cache = True
self.configuration.zfssa_cache_directory = zfssa_cache_dir self.configuration.zfssa_cache_directory = zfssa_cache_dir
self.configuration.nfs_sparsed_volumes = 'true' self.configuration.nfs_sparsed_volumes = 'true'
self.configuration.nfs_mount_point_base = '$state_path/mnt'
self.configuration.nfs_mount_options = None
self.configuration.zfssa_manage_policy = 'strict' self.configuration.zfssa_manage_policy = 'strict'
def test_setup_nfs_client(self): def test_setup_nfs_client(self):

View File

@ -155,8 +155,10 @@ class BaseDriverTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(BaseDriverTestCase, self).setUp() super(BaseDriverTestCase, self).setUp()
vol_tmpdir = tempfile.mkdtemp() vol_tmpdir = tempfile.mkdtemp()
self.flags(volume_driver=self.driver_name, self.override_config('volume_driver', self.driver_name,
volumes_dir=vol_tmpdir) conf.SHARED_CONF_GROUP)
self.override_config('volumes_dir', vol_tmpdir,
conf.SHARED_CONF_GROUP)
self.volume = importutils.import_object(CONF.volume_manager) self.volume = importutils.import_object(CONF.volume_manager)
self.context = context.get_admin_context() self.context = context.get_admin_context()
self.output = "" self.output = ""

View File

@ -43,6 +43,7 @@ from oslo_config import cfg
CONF = cfg.CONF CONF = cfg.CONF
SHARED_CONF_GROUP = 'backend_defaults'
class Configuration(object): class Configuration(object):

View File

@ -31,6 +31,7 @@ from cinder.image import image_utils
from cinder import objects from cinder import objects
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver_utils from cinder.volume import driver_utils
from cinder.volume import rpcapi as volume_rpcapi from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import throttling from cinder.volume import throttling
@ -295,6 +296,8 @@ iser_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(iser_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts)
CONF.register_opts(iser_opts) CONF.register_opts(iser_opts)
CONF.import_opt('backup_use_same_host', 'cinder.backup.api') CONF.import_opt('backup_use_same_host', 'cinder.backup.api')

View File

@ -28,6 +28,7 @@ from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import objects from cinder import objects
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils as volutils from cinder.volume import utils as volutils
@ -41,7 +42,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -30,6 +30,7 @@ from cinder import context
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -63,7 +64,7 @@ blockbridge_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(blockbridge_opts) CONF.register_opts(blockbridge_opts, group=configuration.SHARED_CONF_GROUP)
class BlockbridgeAPIClient(object): class BlockbridgeAPIClient(object):

View File

@ -28,6 +28,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import nfs from cinder.volume.drivers import nfs
from cinder.volume import qos_specs from cinder.volume import qos_specs
from cinder.volume import volume_types from cinder.volume import volume_types
@ -307,7 +308,7 @@ coho_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(coho_opts) CONF.register_opts(coho_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -30,6 +30,7 @@ from cinder import context
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume.drivers.coprhd.helpers import ( from cinder.volume.drivers.coprhd.helpers import (
authentication as coprhd_auth) authentication as coprhd_auth)
from cinder.volume.drivers.coprhd.helpers import ( from cinder.volume.drivers.coprhd.helpers import (
@ -82,7 +83,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
URI_VPOOL_VARRAY_CAPACITY = '/block/vpools/{0}/varrays/{1}/capacity' URI_VPOOL_VARRAY_CAPACITY = '/block/vpools/{0}/varrays/{1}/capacity'
URI_BLOCK_EXPORTS_FOR_INITIATORS = '/block/exports?initiators={0}' URI_BLOCK_EXPORTS_FOR_INITIATORS = '/block/exports?initiators={0}'

View File

@ -26,6 +26,7 @@ from six.moves import urllib
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.coprhd import common as coprhd_common from cinder.volume.drivers.coprhd import common as coprhd_common
@ -55,7 +56,7 @@ scaleio_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(scaleio_opts) CONF.register_opts(scaleio_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -24,6 +24,7 @@ import six
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
import cinder.volume.drivers.datera.datera_api2 as api2 import cinder.volume.drivers.datera.datera_api2 as api2
@ -70,7 +71,7 @@ d_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.import_opt('driver_use_ssl', 'cinder.volume.driver') CONF.import_opt('driver_use_ssl', 'cinder.volume.driver')
CONF.register_opts(d_opts) CONF.register_opts(d_opts, group=configuration.SHARED_CONF_GROUP)
@six.add_metaclass(utils.TraceWrapperWithABCMetaclass) @six.add_metaclass(utils.TraceWrapperWithABCMetaclass)

View File

@ -33,6 +33,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import ssh_utils from cinder import ssh_utils
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import san from cinder.volume.drivers import san
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -54,7 +55,7 @@ eqlx_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(eqlx_opts) CONF.register_opts(eqlx_opts, group=configuration.SHARED_CONF_GROUP)
def with_timeout(f): def with_timeout(f):

View File

@ -22,6 +22,7 @@ import six
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.dell_emc.sc import storagecenter_api from cinder.volume.drivers.dell_emc.sc import storagecenter_api
from cinder.volume.drivers.san.san import san_opts from cinder.volume.drivers.san.san import san_opts
@ -70,7 +71,7 @@ common_opts = [
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
class SCCommonDriver(driver.ManageableVD, class SCCommonDriver(driver.ManageableVD,

View File

@ -41,6 +41,7 @@ from cinder import objects
from cinder import utils from cinder import utils
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import qos_specs from cinder.volume import qos_specs
@ -89,7 +90,7 @@ scaleio_opts = [
'Maximum value allowed for ScaleIO is 10.0.') 'Maximum value allowed for ScaleIO is 10.0.')
] ]
CONF.register_opts(scaleio_opts) CONF.register_opts(scaleio_opts, group=configuration.SHARED_CONF_GROUP)
STORAGE_POOL_NAME = 'sio:sp_name' STORAGE_POOL_NAME = 'sio:sp_name'
STORAGE_POOL_ID = 'sio:sp_id' STORAGE_POOL_ID = 'sio:sp_id'

View File

@ -19,6 +19,7 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.dell_emc.unity import adapter from cinder.volume.drivers.dell_emc.unity import adapter
from cinder.volume.drivers.san.san import san_opts from cinder.volume.drivers.san.san import san_opts
@ -38,7 +39,7 @@ UNITY_OPTS = [
help='A comma-separated list of iSCSI or FC ports to be used. ' help='A comma-separated list of iSCSI or FC ports to be used. '
'Each port can be Unix-style glob expressions.')] 'Each port can be Unix-style glob expressions.')]
CONF.register_opts(UNITY_OPTS) CONF.register_opts(UNITY_OPTS, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -23,6 +23,7 @@ import six
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume.drivers.dell_emc.vmax import masking from cinder.volume.drivers.dell_emc.vmax import masking
from cinder.volume.drivers.dell_emc.vmax import provision from cinder.volume.drivers.dell_emc.vmax import provision
from cinder.volume.drivers.dell_emc.vmax import rest from cinder.volume.drivers.dell_emc.vmax import rest
@ -57,7 +58,7 @@ vmax_opts = [
help='Use this value to enable ' help='Use this value to enable '
'the initiator_check.')] 'the initiator_check.')]
CONF.register_opts(vmax_opts) CONF.register_opts(vmax_opts, group=configuration.SHARED_CONF_GROUP)
class VMAXCommon(object): class VMAXCommon(object):

View File

@ -24,6 +24,7 @@ storops = importutils.try_import('storops')
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume.drivers.dell_emc.vnx import const from cinder.volume.drivers.dell_emc.vnx import const
from cinder.volume import volume_types from cinder.volume import volume_types
@ -105,7 +106,7 @@ VNX_OPTS = [
'By default, the value is False.') 'By default, the value is False.')
] ]
CONF.register_opts(VNX_OPTS) CONF.register_opts(VNX_OPTS, group=configuration.SHARED_CONF_GROUP)
PROTOCOL_FC = 'fc' PROTOCOL_FC = 'fc'

View File

@ -49,6 +49,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.zonemanager import utils as fczm_utils from cinder.zonemanager import utils as fczm_utils
@ -72,7 +73,7 @@ XTREMIO_OPTS = [
default=100, default=100,
help='Number of volumes created from each cached glance image')] help='Number of volumes created from each cached glance image')]
CONF.register_opts(XTREMIO_OPTS) CONF.register_opts(XTREMIO_OPTS, group=configuration.SHARED_CONF_GROUP)
RANDOM = random.Random() RANDOM = random.Random()
OBJ_NOT_FOUND_ERR = 'obj_not_found' OBJ_NOT_FOUND_ERR = 'obj_not_found'

View File

@ -31,6 +31,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.disco import disco_api from cinder.volume.drivers.disco import disco_api
from cinder.volume.drivers.disco import disco_attach_detach from cinder.volume.drivers.disco import disco_attach_detach
@ -99,7 +100,7 @@ DISCO_CODE_MAPPING = {
} }
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(disco_opts) CONF.register_opts(disco_opts, group=configuration.SHARED_CONF_GROUP)
# Driver to communicate with DISCO storage solution # Driver to communicate with DISCO storage solution

View File

@ -28,6 +28,7 @@ from oslo_log import log as logging
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume.drivers.dothill import dothill_client as dothill from cinder.volume.drivers.dothill import dothill_client as dothill
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -58,8 +59,8 @@ iscsi_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(iscsi_opts) CONF.register_opts(iscsi_opts, group=configuration.SHARED_CONF_GROUP)
class DotHillCommon(object): class DotHillCommon(object):

View File

@ -39,6 +39,7 @@ from oslo_utils import units
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
try: try:
@ -108,7 +109,7 @@ drbd_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(drbd_opts) CONF.register_opts(drbd_opts, group=configuration.SHARED_CONF_GROUP)
AUX_PROP_CINDER_VOL_ID = "cinder-id" AUX_PROP_CINDER_VOL_ID = "cinder-id"

View File

@ -28,6 +28,7 @@ import six
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume.drivers.falconstor import rest_proxy from cinder.volume.drivers.falconstor import rest_proxy
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
@ -63,7 +64,7 @@ FSS_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(FSS_OPTS) CONF.register_opts(FSS_OPTS, group=configuration.SHARED_CONF_GROUP)
class FalconstorBaseDriver(san.SanDriver): class FalconstorBaseDriver(san.SanDriver):

View File

@ -28,6 +28,7 @@ from xml.etree.ElementTree import parse
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration as conf
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
@ -134,7 +135,7 @@ RETCODE_dic = {
'35347': 'Copy table size is not enough', '35347': 'Copy table size is not enough',
} }
CONF.register_opts(FJ_ETERNUS_DX_OPT_opts) CONF.register_opts(FJ_ETERNUS_DX_OPT_opts, group=conf.SHARED_CONF_GROUP)
class FJDXCommon(object): class FJDXCommon(object):

View File

@ -27,6 +27,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.fusionstorage import fspythonapi from cinder.volume.drivers.fusionstorage import fspythonapi
@ -54,7 +55,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
OLD_VERSION = 1 OLD_VERSION = 1
NEW_VERSION = 0 NEW_VERSION = 0

View File

@ -37,6 +37,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils as volutils from cinder.volume import utils as volutils
@ -66,7 +67,7 @@ hgst_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(hgst_opts) CONF.register_opts(hgst_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -26,6 +26,7 @@ import six
from cinder import exception from cinder import exception
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
from cinder.volume.drivers.hitachi import hbsd_horcm as horcm from cinder.volume.drivers.hitachi import hbsd_horcm as horcm
from cinder.volume.drivers.hitachi import hbsd_snm2 as snm2 from cinder.volume.drivers.hitachi import hbsd_snm2 as snm2
@ -89,7 +90,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
class TryLock(object): class TryLock(object):

View File

@ -29,6 +29,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
import cinder.volume.driver import cinder.volume.driver
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
from cinder.volume.drivers.hitachi import hbsd_common as common from cinder.volume.drivers.hitachi import hbsd_common as common
@ -43,7 +44,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -29,6 +29,7 @@ import six
from cinder import exception from cinder import exception
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
GETSTORAGEARRAY_ONCE = 100 GETSTORAGEARRAY_ONCE = 100
@ -116,7 +117,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
def horcm_synchronized(function): def horcm_synchronized(function):

View File

@ -28,6 +28,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
import cinder.volume.driver import cinder.volume.driver
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
from cinder.volume.drivers.hitachi import hbsd_common as common from cinder.volume.drivers.hitachi import hbsd_common as common
@ -51,7 +52,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -33,6 +33,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils as cutils from cinder import utils as cutils
from cinder.volume import configuration
from cinder.volume.drivers.hitachi import hnas_backend from cinder.volume.drivers.hitachi import hnas_backend
from cinder.volume.drivers.hitachi import hnas_utils from cinder.volume.drivers.hitachi import hnas_utils
from cinder.volume.drivers import nfs from cinder.volume.drivers import nfs
@ -53,7 +54,7 @@ NFS_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(NFS_OPTS) CONF.register_opts(NFS_OPTS, group=configuration.SHARED_CONF_GROUP)
HNAS_DEFAULT_CONFIG = {'ssc_cmd': 'ssc', 'ssh_port': '22'} HNAS_DEFAULT_CONFIG = {'ssc_cmd': 'ssc', 'ssh_port': '22'}

View File

@ -27,6 +27,7 @@ from xml.etree import ElementTree as ETree
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume import volume_types from cinder.volume import volume_types
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -83,7 +84,7 @@ drivers_common_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(drivers_common_opts) CONF.register_opts(drivers_common_opts, group=configuration.SHARED_CONF_GROUP)
def _check_conf_params(config, pool_name, idx): def _check_conf_params(config, pool_name, idx):

View File

@ -26,6 +26,7 @@ import six
from cinder import coordination from cinder import coordination
from cinder import exception from cinder import exception
from cinder import utils as cinder_utils from cinder import utils as cinder_utils
from cinder.volume import configuration
from cinder.volume.drivers.hitachi import vsp_utils as utils from cinder.volume.drivers.hitachi import vsp_utils as utils
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -111,7 +112,7 @@ _REQUIRED_COMMON_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
MSG = utils.VSPMsg MSG = utils.VSPMsg

View File

@ -17,6 +17,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.hitachi import vsp_common as common from cinder.volume.drivers.hitachi import vsp_common as common
from cinder.volume.drivers.hitachi import vsp_utils as utils from cinder.volume.drivers.hitachi import vsp_utils as utils
@ -45,7 +46,7 @@ _DRIVER_INFO = {
} }
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(fc_opts) CONF.register_opts(fc_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -32,6 +32,7 @@ from six.moves import range
from cinder import coordination from cinder import coordination
from cinder import exception from cinder import exception
from cinder import utils as cinder_utils from cinder import utils as cinder_utils
from cinder.volume import configuration
from cinder.volume.drivers.hitachi import vsp_common as common from cinder.volume.drivers.hitachi import vsp_common as common
from cinder.volume.drivers.hitachi import vsp_utils as utils from cinder.volume.drivers.hitachi import vsp_utils as utils
@ -223,7 +224,7 @@ _REQUIRED_HORCM_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(horcm_opts) CONF.register_opts(horcm_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
MSG = utils.VSPMsg MSG = utils.VSPMsg

View File

@ -17,6 +17,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.hitachi import vsp_common as common from cinder.volume.drivers.hitachi import vsp_common as common
from cinder.volume.drivers.hitachi import vsp_utils as utils from cinder.volume.drivers.hitachi import vsp_utils as utils
@ -52,7 +53,7 @@ _DRIVER_INFO = {
} }
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(iscsi_opts) CONF.register_opts(iscsi_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -62,6 +62,7 @@ from cinder import exception
from cinder import flow_utils from cinder import flow_utils
from cinder.i18n import _ from cinder.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume import qos_specs from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
from cinder.volume import volume_types from cinder.volume import volume_types
@ -128,7 +129,7 @@ hpe3par_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(hpe3par_opts) CONF.register_opts(hpe3par_opts, group=configuration.SHARED_CONF_GROUP)
# Input/output (total read/write) operations per second. # Input/output (total read/write) operations per second.
THROUGHPUT = 'throughput' THROUGHPUT = 'throughput'

View File

@ -47,6 +47,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils as cinder_utils from cinder import utils as cinder_utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils from cinder.volume import utils
@ -98,7 +99,7 @@ hpelefthand_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(hpelefthand_opts) CONF.register_opts(hpelefthand_opts, group=configuration.SHARED_CONF_GROUP)
MIN_API_VERSION = "1.1" MIN_API_VERSION = "1.1"
MIN_CLIENT_VERSION = '2.1.0' MIN_CLIENT_VERSION = '2.1.0'

View File

@ -31,6 +31,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.huawei import constants from cinder.volume.drivers.huawei import constants
from cinder.volume.drivers.huawei import fc_zone_helper from cinder.volume.drivers.huawei import fc_zone_helper
@ -72,7 +73,7 @@ huawei_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(huawei_opts) CONF.register_opts(huawei_opts, group=configuration.SHARED_CONF_GROUP)
snap_attrs = ('id', 'volume_id', 'volume', 'provider_location') snap_attrs = ('id', 'volume_id', 'volume', 'provider_location')
Snapshot = collections.namedtuple('Snapshot', snap_attrs) Snapshot = collections.namedtuple('Snapshot', snap_attrs)

View File

@ -38,6 +38,7 @@ from cinder import context
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -60,7 +61,7 @@ flashsystem_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(flashsystem_opts) CONF.register_opts(flashsystem_opts, group=configuration.SHARED_CONF_GROUP)
class FlashSystemDriver(san.SanDriver, class FlashSystemDriver(san.SanDriver,

View File

@ -35,6 +35,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.ibm import flashsystem_common as fscommon from cinder.volume.drivers.ibm import flashsystem_common as fscommon
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.zonemanager import utils as fczm_utils from cinder.zonemanager import utils as fczm_utils
@ -50,7 +51,7 @@ flashsystem_fc_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(flashsystem_fc_opts) CONF.register_opts(flashsystem_fc_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -35,6 +35,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration as conf
from cinder.volume.drivers.ibm import flashsystem_common as fscommon from cinder.volume.drivers.ibm import flashsystem_common as fscommon
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
@ -48,7 +49,7 @@ flashsystem_iscsi_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(flashsystem_iscsi_opts) CONF.register_opts(flashsystem_iscsi_opts, group=conf.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -35,6 +35,7 @@ from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers import nfs from cinder.volume.drivers import nfs
from cinder.volume.drivers import remotefs from cinder.volume.drivers import remotefs
@ -116,8 +117,8 @@ gpfs_remote_ssh_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(gpfs_opts) CONF.register_opts(gpfs_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(gpfs_remote_ssh_opts) CONF.register_opts(gpfs_remote_ssh_opts, group=configuration.SHARED_CONF_GROUP)
def _different(difference_tuple): def _different(difference_tuple):

View File

@ -70,6 +70,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import objects from cinder import objects
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import configuration
import cinder.volume.drivers.ibm.ibm_storage as storage import cinder.volume.drivers.ibm.ibm_storage as storage
from cinder.volume.drivers.ibm.ibm_storage import ( from cinder.volume.drivers.ibm.ibm_storage import (
ds8k_replication as replication) ds8k_replication as replication)
@ -120,7 +121,7 @@ ds8k_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(ds8k_opts) CONF.register_opts(ds8k_opts, group=configuration.SHARED_CONF_GROUP)
class Lun(object): class Lun(object):

View File

@ -25,6 +25,7 @@ from oslo_utils import importutils
from cinder import exception from cinder import exception
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.zonemanager import utils as fczm_utils from cinder.zonemanager import utils as fczm_utils
@ -52,7 +53,7 @@ driver_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(driver_opts) CONF.register_opts(driver_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -39,6 +39,7 @@ from cinder import objects
from cinder.objects import fields from cinder.objects import fields
from cinder import ssh_utils from cinder import ssh_utils
from cinder import utils as cinder_utils from cinder import utils as cinder_utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.ibm.storwize_svc import ( from cinder.volume.drivers.ibm.storwize_svc import (
replication as storwize_rep) replication as storwize_rep)
@ -127,7 +128,7 @@ storwize_svc_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(storwize_svc_opts) CONF.register_opts(storwize_svc_opts, group=configuration.SHARED_CONF_GROUP)
class StorwizeSSH(object): class StorwizeSSH(object):

View File

@ -42,6 +42,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.ibm.storwize_svc import ( from cinder.volume.drivers.ibm.storwize_svc import (
storwize_svc_common as storwize_common) storwize_svc_common as storwize_common)
from cinder.zonemanager import utils as fczm_utils from cinder.zonemanager import utils as fczm_utils
@ -56,7 +57,7 @@ storwize_svc_fc_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(storwize_svc_fc_opts) CONF.register_opts(storwize_svc_fc_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -42,6 +42,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration as conf
from cinder.volume.drivers.ibm.storwize_svc import ( from cinder.volume.drivers.ibm.storwize_svc import (
storwize_svc_common as storwize_common) storwize_svc_common as storwize_common)
@ -56,7 +57,7 @@ storwize_svc_iscsi_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(storwize_svc_iscsi_opts) CONF.register_opts(storwize_svc_iscsi_opts, group=conf.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -33,6 +33,7 @@ from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder import version from cinder import version
from cinder.volume import configuration
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils as vol_utils from cinder.volume import utils as vol_utils
from cinder.zonemanager import utils as fczm_utils from cinder.zonemanager import utils as fczm_utils
@ -74,7 +75,7 @@ infinidat_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(infinidat_opts) CONF.register_opts(infinidat_opts, group=configuration.SHARED_CONF_GROUP)
def infinisdk_to_cinder_exceptions(func): def infinisdk_to_cinder_exceptions(func):

View File

@ -27,6 +27,7 @@ from oslo_utils import units
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration as conf
from cinder.volume.drivers.infortrend.raidcmd_cli import cli_factory as cli from cinder.volume.drivers.infortrend.raidcmd_cli import cli_factory as cli
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import volume_types from cinder.volume import volume_types
@ -79,8 +80,8 @@ infortrend_esds_extra_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(infortrend_esds_opts) CONF.register_opts(infortrend_esds_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(infortrend_esds_extra_opts) CONF.register_opts(infortrend_esds_extra_opts, group=conf.SHARED_CONF_GROUP)
CLI_RC_FILTER = { CLI_RC_FILTER = {
'CreatePartition': {'error': _('Failed to create partition.')}, 'CreatePartition': {'error': _('Failed to create partition.')},

View File

@ -34,6 +34,7 @@ from cinder.i18n import _
from cinder import objects from cinder import objects
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils as vol_utils from cinder.volume import utils as vol_utils
@ -52,7 +53,7 @@ kaminario_opts = [
"on setting this option as True.")] "on setting this option as True.")]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(kaminario_opts) CONF.register_opts(kaminario_opts, group=configuration.SHARED_CONF_GROUP)
K2HTTPError = requests.exceptions.HTTPError K2HTTPError = requests.exceptions.HTTPError
K2_RETRY_ERRORS = ("MC_ERR_BUSY", "MC_ERR_BUSY_SPECIFIC", K2_RETRY_ERRORS = ("MC_ERR_BUSY", "MC_ERR_BUSY_SPECIFIC",

View File

@ -16,6 +16,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder.volume import configuration
from cinder.volume.drivers.dothill import dothill_common from cinder.volume.drivers.dothill import dothill_common
from cinder.volume.drivers.lenovo import lenovo_client from cinder.volume.drivers.lenovo import lenovo_client
@ -45,8 +46,8 @@ iscsi_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(iscsi_opts) CONF.register_opts(iscsi_opts, group=configuration.SHARED_CONF_GROUP)
class LenovoCommon(dothill_common.DotHillCommon): class LenovoCommon(dothill_common.DotHillCommon):

View File

@ -33,6 +33,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils as volutils from cinder.volume import utils as volutils
@ -77,7 +78,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -29,6 +29,7 @@ from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume.drivers.nec import cli from cinder.volume.drivers.nec import cli
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import qos_specs from cinder.volume import qos_specs
@ -101,7 +102,7 @@ mstorage_opts = [
help='Number of iSCSI portals.'), help='Number of iSCSI portals.'),
] ]
FLAGS.register_opts(mstorage_opts) FLAGS.register_opts(mstorage_opts, group=configuration.SHARED_CONF_GROUP)
def convert_to_name(uuid): def convert_to_name(uuid):

View File

@ -27,6 +27,8 @@ place to ensure re usability and better management of configuration options.
from oslo_config import cfg from oslo_config import cfg
from oslo_config import types from oslo_config import types
from cinder.volume import configuration as conf
NETAPP_SIZE_MULTIPLIER_DEFAULT = 1.2 NETAPP_SIZE_MULTIPLIER_DEFAULT = 1.2
netapp_proxy_opts = [ netapp_proxy_opts = [
@ -213,15 +215,15 @@ netapp_replication_opts = [
'during a failover.'), ] 'during a failover.'), ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(netapp_proxy_opts) CONF.register_opts(netapp_proxy_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_connection_opts) CONF.register_opts(netapp_connection_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_transport_opts) CONF.register_opts(netapp_transport_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_basicauth_opts) CONF.register_opts(netapp_basicauth_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_cluster_opts) CONF.register_opts(netapp_cluster_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_7mode_opts) CONF.register_opts(netapp_7mode_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_provisioning_opts) CONF.register_opts(netapp_provisioning_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_img_cache_opts) CONF.register_opts(netapp_img_cache_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_eseries_opts) CONF.register_opts(netapp_eseries_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_nfs_extra_opts) CONF.register_opts(netapp_nfs_extra_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_san_opts) CONF.register_opts(netapp_san_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_replication_opts) CONF.register_opts(netapp_replication_opts, group=conf.SHARED_CONF_GROUP)

View File

@ -15,6 +15,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder.volume import configuration as conf
NEXENTA_EDGE_OPTS = [ NEXENTA_EDGE_OPTS = [
cfg.StrOpt('nexenta_nbd_symlinks_dir', cfg.StrOpt('nexenta_nbd_symlinks_dir',
@ -147,9 +148,9 @@ NEXENTA_RRMGR_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(NEXENTA_CONNECTION_OPTS) CONF.register_opts(NEXENTA_CONNECTION_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_ISCSI_OPTS) CONF.register_opts(NEXENTA_ISCSI_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_DATASET_OPTS) CONF.register_opts(NEXENTA_DATASET_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_NFS_OPTS) CONF.register_opts(NEXENTA_NFS_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_RRMGR_OPTS) CONF.register_opts(NEXENTA_RRMGR_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_EDGE_OPTS) CONF.register_opts(NEXENTA_EDGE_OPTS, group=conf.SHARED_CONF_GROUP)

View File

@ -31,6 +31,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers import remotefs from cinder.volume.drivers import remotefs
@ -71,7 +72,7 @@ nfs_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(nfs_opts) CONF.register_opts(nfs_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver
@ -96,12 +97,10 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed, driver.ExtendVD):
root_helper = utils.get_root_helper() root_helper = utils.get_root_helper()
# base bound to instance is used in RemoteFsConnector. # base bound to instance is used in RemoteFsConnector.
self.base = getattr(self.configuration, self.base = getattr(self.configuration,
'nfs_mount_point_base', 'nfs_mount_point_base')
CONF.nfs_mount_point_base)
self.base = os.path.realpath(self.base) self.base = os.path.realpath(self.base)
opts = getattr(self.configuration, opts = getattr(self.configuration,
'nfs_mount_options', 'nfs_mount_options')
CONF.nfs_mount_options)
nas_mount_options = getattr(self.configuration, nas_mount_options = getattr(self.configuration,
'nas_mount_options', 'nas_mount_options',

View File

@ -38,6 +38,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.objects import volume from cinder.objects import volume
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import volume_types from cinder.volume import volume_types
@ -93,7 +94,7 @@ nimble_opts = [
help='Path to Nimble Array SSL certificate'), ] help='Path to Nimble Array SSL certificate'), ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(nimble_opts) CONF.register_opts(nimble_opts, group=configuration.SHARED_CONF_GROUP)
class NimbleDriverException(exception.VolumeDriverException): class NimbleDriverException(exception.VolumeDriverException):

View File

@ -16,6 +16,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder.volume import configuration
DPL_OPTS = [ DPL_OPTS = [
cfg.StrOpt('dpl_pool', cfg.StrOpt('dpl_pool',
@ -27,4 +28,4 @@ DPL_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(DPL_OPTS) CONF.register_opts(DPL_OPTS, group=configuration.SHARED_CONF_GROUP)

View File

@ -36,6 +36,7 @@ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -82,7 +83,7 @@ PURE_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(PURE_OPTS) CONF.register_opts(PURE_OPTS, group=configuration.SHARED_CONF_GROUP)
INVALID_CHARACTERS = re.compile(r"[^-a-zA-Z0-9]") INVALID_CHARACTERS = re.compile(r"[^-a-zA-Z0-9]")
GENERATED_NAME = re.compile(r".*-[a-f0-9]{32}-cinder$") GENERATED_NAME = re.compile(r".*-[a-f0-9]{32}-cinder$")

View File

@ -38,6 +38,7 @@ from six.moves import urllib
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -53,7 +54,7 @@ qnap_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(qnap_opts) CONF.register_opts(qnap_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -29,6 +29,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv from cinder.volume.drivers import remotefs as remotefs_drv
VERSION = '1.1.5' VERSION = '1.1.5'
@ -56,7 +57,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -33,6 +33,7 @@ from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
try: try:
@ -94,7 +95,7 @@ RBD_OPTS = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(RBD_OPTS) CONF.register_opts(RBD_OPTS, group=configuration.SHARED_CONF_GROUP)
EXTRA_SPECS_REPL_ENABLED = "replication_enabled" EXTRA_SPECS_REPL_ENABLED = "replication_enabled"

View File

@ -37,6 +37,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -99,8 +100,8 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(nas_opts) CONF.register_opts(nas_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
# TODO(bluex): remove when drivers stop using it # TODO(bluex): remove when drivers stop using it

View File

@ -16,6 +16,7 @@
from oslo_config import cfg from oslo_config import cfg
from cinder.volume import configuration
from cinder.volume.drivers.dothill import dothill_common from cinder.volume.drivers.dothill import dothill_common
from cinder.volume.drivers.san.hp import hpmsa_client from cinder.volume.drivers.san.hp import hpmsa_client
@ -46,8 +47,8 @@ iscsi_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(iscsi_opts) CONF.register_opts(iscsi_opts, group=configuration.SHARED_CONF_GROUP)
class HPMSACommon(dothill_common.DotHillCommon): class HPMSACommon(dothill_common.DotHillCommon):

View File

@ -31,6 +31,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import ssh_utils from cinder import ssh_utils
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -74,7 +75,7 @@ san_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(san_opts) CONF.register_opts(san_opts, group=configuration.SHARED_CONF_GROUP)
class SanDriver(driver.BaseVD): class SanDriver(driver.BaseVD):

View File

@ -36,6 +36,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
@ -52,7 +53,7 @@ sheepdog_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.import_opt("image_conversion_dir", "cinder.image.image_utils") CONF.import_opt("image_conversion_dir", "cinder.image.image_utils")
CONF.register_opts(sheepdog_opts) CONF.register_opts(sheepdog_opts, group=configuration.SHARED_CONF_GROUP)
class SheepdogClient(object): class SheepdogClient(object):

View File

@ -39,6 +39,7 @@ from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder.objects import fields from cinder.objects import fields
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import qos_specs from cinder.volume import qos_specs
from cinder.volume.targets import iscsi as iscsi_driver from cinder.volume.targets import iscsi as iscsi_driver
@ -101,7 +102,7 @@ sf_opts = [
help='Utilize volume access groups on a per-tenant basis.')] help='Utilize volume access groups on a per-tenant basis.')]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(sf_opts) CONF.register_opts(sf_opts, group=configuration.SHARED_CONF_GROUP)
# SolidFire API Error Constants # SolidFire API Error Constants
xExceededLimit = 'xExceededLimit' xExceededLimit = 'xExceededLimit'

View File

@ -43,6 +43,7 @@ from cinder.i18n import _
from cinder.objects import snapshot from cinder.objects import snapshot
from cinder.objects import volume from cinder.objects import volume
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import utils as volutils from cinder.volume import utils as volutils
@ -79,7 +80,7 @@ cinder_opts = [
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(cinder_opts) CONF.register_opts(cinder_opts, group=configuration.SHARED_CONF_GROUP)
class AESCipher(object): class AESCipher(object):

View File

@ -29,6 +29,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
@ -48,7 +49,7 @@ tegile_opts = [
help='Create volumes in this project')] help='Create volumes in this project')]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(tegile_opts) CONF.register_opts(tegile_opts, group=configuration.SHARED_CONF_GROUP)
def debugger(func): def debugger(func):

View File

@ -35,6 +35,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers import nfs from cinder.volume.drivers import nfs
@ -63,7 +64,7 @@ tintri_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(tintri_opts) CONF.register_opts(tintri_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver

View File

@ -44,6 +44,7 @@ from cinder.db.sqlalchemy import api
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import volume_types from cinder.volume import volume_types
@ -94,7 +95,7 @@ violin_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(violin_opts) CONF.register_opts(violin_opts, group=configuration.SHARED_CONF_GROUP)
class V7000Common(object): class V7000Common(object):

View File

@ -39,6 +39,7 @@ from oslo_vmware import vim_util
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.vmware import datastore as hub from cinder.volume.drivers.vmware import datastore as hub
from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions
@ -130,7 +131,7 @@ vmdk_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(vmdk_opts) CONF.register_opts(vmdk_opts, group=configuration.SHARED_CONF_GROUP)
def _get_volume_type_extra_spec(type_id, spec_key, possible_values=None, def _get_volume_type_extra_spec(type_id, spec_key, possible_values=None,

View File

@ -31,6 +31,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv from cinder.volume.drivers import remotefs as remotefs_drv
VERSION = '1.0' VERSION = '1.0'
@ -66,7 +67,7 @@ vzstorage_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(vzstorage_opts) CONF.register_opts(vzstorage_opts, group=configuration.SHARED_CONF_GROUP)
PLOOP_BASE_DELTA_NAME = 'root.hds' PLOOP_BASE_DELTA_NAME = 'root.hds'
DISK_FORMAT_RAW = 'raw' DISK_FORMAT_RAW = 'raw'
@ -170,12 +171,8 @@ class VZStorageDriver(remotefs_drv.RemoteFSSnapDriver):
self._execute_as_root = False self._execute_as_root = False
root_helper = utils.get_root_helper() root_helper = utils.get_root_helper()
# base bound to instance is used in RemoteFsConnector. # base bound to instance is used in RemoteFsConnector.
self.base = getattr(self.configuration, self.base = self.configuration.vzstorage_mount_point_base
'vzstorage_mount_point_base', opts = self.configuration.vzstorage_mount_options
CONF.vzstorage_mount_point_base)
opts = getattr(self.configuration,
'vzstorage_mount_options',
CONF.vzstorage_mount_options)
self._remotefsclient = remotefs.RemoteFsClient( self._remotefsclient = remotefs.RemoteFsClient(
'vzstorage', root_helper, execute=execute, 'vzstorage', root_helper, execute=execute,

View File

@ -30,6 +30,7 @@ from cinder.i18n import _
from cinder.image import image_utils from cinder.image import image_utils
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv from cinder.volume.drivers import remotefs as remotefs_drv
VERSION = '1.1.0' VERSION = '1.1.0'
@ -79,7 +80,7 @@ volume_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(volume_opts) CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver @interface.volumedriver
@ -114,8 +115,7 @@ class WindowsSmbfsDriver(remotefs_drv.RemoteFSPoolMixin,
self.configuration.append_config_values(volume_opts) self.configuration.append_config_values(volume_opts)
self.base = getattr(self.configuration, self.base = getattr(self.configuration,
'smbfs_mount_point_base', 'smbfs_mount_point_base')
CONF.smbfs_mount_point_base)
self._remotefsclient = remotefs_brick.WindowsRemoteFsClient( self._remotefsclient = remotefs_brick.WindowsRemoteFsClient(
'cifs', root_helper=None, smbfs_mount_point_base=self.base, 'cifs', root_helper=None, smbfs_mount_point_base=self.base,
local_path_for_loopback=True) local_path_for_loopback=True)

View File

@ -30,6 +30,7 @@ from oslo_utils import units
from oslo_utils import uuidutils from oslo_utils import uuidutils
from cinder.image import image_utils from cinder.image import image_utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import utils from cinder.volume import utils
@ -42,7 +43,7 @@ windows_opts = [
] ]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(windows_opts) CONF.register_opts(windows_opts, group=configuration.SHARED_CONF_GROUP)
class WindowsDriver(driver.ISCSIDriver): class WindowsDriver(driver.ISCSIDriver):

View File

@ -23,6 +23,7 @@ from six.moves import urllib
from cinder import context from cinder import context
from cinder import exception from cinder import exception
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume import qos_specs from cinder.volume import qos_specs
@ -46,7 +47,7 @@ XIO_OPTS = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(XIO_OPTS) CONF.register_opts(XIO_OPTS, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -27,6 +27,7 @@ import six
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -69,7 +70,7 @@ zadara_opts = [
help="VPSA - Attach snapshot policy for volumes")] help="VPSA - Attach snapshot policy for volumes")]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(zadara_opts) CONF.register_opts(zadara_opts, group=configuration.SHARED_CONF_GROUP)
class ZadaraVPSAConnection(object): class ZadaraVPSAConnection(object):

View File

@ -28,6 +28,7 @@ from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import interface from cinder import interface
from cinder import utils from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume.drivers.san import san from cinder.volume.drivers.san import san
from cinder.volume.drivers.zfssa import zfssarest from cinder.volume.drivers.zfssa import zfssarest
@ -91,7 +92,7 @@ ZFSSA_OPTS = [
help='Driver policy for volume manage.') help='Driver policy for volume manage.')
] ]
CONF.register_opts(ZFSSA_OPTS) CONF.register_opts(ZFSSA_OPTS, group=configuration.SHARED_CONF_GROUP)
ZFSSA_LUN_SPECS = { ZFSSA_LUN_SPECS = {
'zfssa:volblocksize', 'zfssa:volblocksize',

Some files were not shown because too many files have changed in this diff Show More