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 textwrap
from cinder.volume import configuration
OrderedDict = collections.OrderedDict
BASEDIR = os.path.split(os.path.realpath(__file__))[0] + "/../../"
@ -208,6 +210,12 @@ if __name__ == "__main__":
', group=\"\'', '').replace(
', group=', '').strip(
"\'\")").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:
line = key + "." + formatted_opt
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_same_az_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.iser_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_zfssanfs.ZFSSA_OPTS,
cinder_volume_drivers_zte_zteks.zte_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,
cinder_volume_manager.volume_backend_opts,
)),
]

View File

@ -68,7 +68,8 @@ class _FunctionalTestBase(test.TestCase):
super(_FunctionalTestBase, self).setUp()
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'):
self.useFixture(fixtures.EnvironmentVariable(var))
@ -107,15 +108,15 @@ class _FunctionalTestBase(test.TestCase):
f = {}
# 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
f['osapi_volume_listen_port'] = 0
f['osapi_volume_listen_port'] = {'v': 0}
# Use simple scheduler to avoid complications - we test schedulers
# separately
f['scheduler_driver'] = ('cinder.scheduler.filter_scheduler.FilterSche'
'duler')
f['scheduler_driver'] = {'v': ('cinder.scheduler.filter_scheduler.'
'FilterScheduler')}
return f

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,11 +18,13 @@ import os
from oslo_config import cfg
from cinder.volume import configuration
CONF = cfg.CONF
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('api_class', 'cinder.keymgr', 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):
conf.set_default('default_volume_type', def_vol_type)
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('rpc_backend', 'cinder.openstack.common.rpc.impl_fake')
conf.set_default('connection', 'sqlite://', group='database')

View File

@ -18,6 +18,8 @@ import six
from cinder import test
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):
@ -115,11 +117,37 @@ class TestScaleIODriver(test.TestCase):
``MockHTTPSResponse``'s instead.
"""
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, '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):
"""Do a fake GET/POST API request.

View File

@ -16,47 +16,18 @@ import json
import requests
import six
from cinder.volume import configuration as conf
from cinder.volume.drivers.dell_emc.scaleio import driver
from oslo_config import cfg
from cinder.volume.drivers.dell_emc.scaleio import driver
CONF = cfg.CONF
class ScaleIODriver(driver.ScaleIODriver):
"""Mock ScaleIO Driver class.
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):
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.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestDeleteSnapShot(scaleio.TestScaleIODriver):
@ -88,8 +89,7 @@ class TestDeleteSnapShot(scaleio.TestScaleIODriver):
def test_delete_snapshot(self):
"""Setting the unmap volume before delete flag for tests """
self.driver.configuration.set_override(
'sio_unmap_volume_before_deletion',
override=True)
self.override_config('sio_unmap_volume_before_deletion', True,
configuration.SHARED_CONF_GROUP)
self.set_https_response_mode(self.RESPONSE_MODE.Valid)
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.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestDeleteVolume(scaleio.TestScaleIODriver):
@ -76,7 +77,6 @@ class TestDeleteVolume(scaleio.TestScaleIODriver):
def test_delete_volume(self):
"""Setting the unmap volume before delete flag for tests """
self.driver.configuration.set_override(
'sio_unmap_volume_before_deletion',
override=True)
self.override_config('sio_unmap_volume_before_deletion', True,
configuration.SHARED_CONF_GROUP)
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.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
class TestExtendVolume(scaleio.TestScaleIODriver):
@ -91,14 +92,14 @@ class TestExtendVolume(scaleio.TestScaleIODriver):
self.NEW_SIZE)
def test_extend_volume_bad_size_no_round(self):
self.driver.configuration.set_override('sio_round_volume_capacity',
override=False)
self.override_config('sio_round_volume_capacity', False,
configuration.SHARED_CONF_GROUP)
self.set_https_response_mode(self.RESPONSE_MODE.Valid)
self.driver.extend_volume(self.volume, self.BAD_SIZE)
def test_extend_volume_bad_size_round(self):
self.driver.configuration.set_override('sio_round_volume_capacity',
override=True)
self.override_config('sio_round_volume_capacity', True,
configuration.SHARED_CONF_GROUP)
self.driver.extend_volume(self.volume, self.BAD_SIZE)
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.volume.drivers.dell_emc import scaleio
from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks
from cinder.volume import configuration
@ddt.ddt
@ -133,8 +134,8 @@ class TestMisc(scaleio.TestScaleIODriver):
self.driver._check_volume_size(1)
def test_volume_size_round_false(self):
self.driver.configuration.set_override('sio_round_volume_capacity',
override=False)
self.override_config('sio_round_volume_capacity', False,
configuration.SHARED_CONF_GROUP)
self.assertRaises(exception.VolumeBackendAPIException,
self.driver._check_volume_size, 1)
@ -268,8 +269,9 @@ class TestMisc(scaleio.TestScaleIODriver):
@ddt.unpack
def test_default_provisioning_type_thin(self, config_provisioning_type,
expected_provisioning_type):
self.driver = mocks.ScaleIODriver(
san_thin_provision=config_provisioning_type)
self.override_config('san_thin_provision', config_provisioning_type,
configuration.SHARED_CONF_GROUP)
self.driver = mocks.ScaleIODriver(configuration=self.configuration)
empty_storage_type = {}
self.assertEqual(
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.nfs_shares_config = 'fake_nfs_share.xml'
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)

View File

@ -151,15 +151,23 @@ class HNASUtilsTest(test.TestCase):
def setUp(self):
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_password', 'supervisor')
self.override_config('hnas_mgmt_ip0', '172.24.44.15')
self.override_config('hnas_svc0_pool_name', 'default')
self.override_config('hnas_svc0_hdp', 'easy-stack')
self.override_config('hnas_svc1_pool_name', 'FS-CinderDev1')
self.override_config('hnas_svc1_hdp', 'silver')
self.override_config('hnas_username', 'supervisor',
conf.SHARED_CONF_GROUP)
self.override_config('hnas_password', 'supervisor',
conf.SHARED_CONF_GROUP)
self.override_config('hnas_mgmt_ip0', '172.24.44.15',
conf.SHARED_CONF_GROUP)
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.volume = fake_volume.fake_volume_obj(self.context, **_VOLUME)
@ -281,9 +289,9 @@ class HNASUtilsTest(test.TestCase):
self.assertEqual(config_from_cinder_conf, out)
def test_read_cinder_conf_break(self):
self.override_config('hnas_username', None)
self.override_config('hnas_password', None)
self.override_config('hnas_mgmt_ip0', None)
self.override_config('hnas_username', None, conf.SHARED_CONF_GROUP)
self.override_config('hnas_password', None, conf.SHARED_CONF_GROUP)
self.override_config('hnas_mgmt_ip0', None, conf.SHARED_CONF_GROUP)
out = hnas_utils.read_cinder_conf(self.fake_conf)
self.assertIsNone(out)
@ -291,7 +299,7 @@ class HNASUtilsTest(test.TestCase):
'hnas_mgmt_ip0', 'hnas_svc0_pool_name',
'hnas_svc0_hdp', )
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,
hnas_utils.read_cinder_conf, self.fake_conf)

View File

@ -27,6 +27,7 @@ import re
import time
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import units
import six
@ -55,6 +56,8 @@ from cinder.volume import volume_types
SVC_POOLS = ['openstack', 'openstack1']
CONF = cfg.CONF
def _get_test_pool(get_all=False):
if get_all:
@ -2240,7 +2243,7 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
self.USESIM = True
if self.USESIM:
self.iscsi_driver = StorwizeSVCISCSIFakeDriver(
configuration=conf.Configuration(None))
configuration=conf.Configuration([], conf.SHARED_CONF_GROUP))
self._def_flags = {'san_ip': 'hostname',
'san_login': 'user',
'san_password': 'pass',
@ -2265,7 +2268,7 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
self._reset_flags()
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.iscsi_driver.db = self.db
self.iscsi_driver.do_setup(None)
@ -2274,10 +2277,10 @@ class StorwizeSVCISCSIDriverTestCase(test.TestCase):
def _set_flag(self, flag, value):
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):
self.iscsi_driver.configuration.local_conf.reset()
CONF.reset()
for k, v in self._def_flags.items():
self._set_flag(k, v)
@ -3436,7 +3439,8 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
'storwize_svc_flashcopy_timeout': 20,
'storwize_svc_flashcopy_rate': 49,
'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__
self._reset_flags(config)
self.driver = StorwizeSVCISCSIFakeDriver(
@ -3460,7 +3464,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
else:
self._reset_flags()
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.driver.db = self.db
self.driver.do_setup(None)
@ -3474,12 +3478,12 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
if not configuration:
configuration = self.driver.configuration
group = configuration.config_group
configuration.set_override(flag, value, group)
self.override_config(flag, value, group)
def _reset_flags(self, configuration=None):
if not configuration:
configuration = self.driver.configuration
configuration.local_conf.reset()
CONF.reset()
for k, v in self._def_flags.items():
self._set_flag(k, v, configuration)
@ -6183,7 +6187,6 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
self.driver.configuration.set_override(flag, value, group)
def _reset_flags(self):
self.driver.configuration.local_conf.reset()
for k, v in self._def_flags.items():
self._set_flag(k, v)
self.driver.configuration.set_override('replication_device',
@ -6604,7 +6607,8 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
self.assertEqual({'_name_id': None}, model_update)
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,
backend_volume,
'available')

View File

@ -37,7 +37,8 @@ class InfortrendTestCass(test.TestCase):
super(InfortrendTestCass, self).setUp()
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.safe_get = self._fake_safe_get

View File

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

View File

@ -66,7 +66,8 @@ class GPFSDriverTestCase(test.TestCase):
os.mkdir(self.images_dir)
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
exec_patcher = mock.patch.object(self.driver, '_execute',
self._execute_wrapper)
@ -77,8 +78,10 @@ class GPFSDriverTestCase(test.TestCase):
self.driver._storage_pool = 'system'
self.driver._encryption_state = 'yes'
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=self.volumes_path)
self.override_config('volume_driver', self.driver_name,
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.user_id = 'fake'
@ -533,104 +536,91 @@ class GPFSDriverTestCase(test.TestCase):
# fail configuration.gpfs_mount_point_base is None
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)
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=org_value)
self.override_config('gpfs_mount_point_base', org_value,
conf.SHARED_CONF_GROUP)
# fail configuration.gpfs_images_share_mode and
# configuration.gpfs_images_dir is None
org_value_share_mode = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy')
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_images_share_mode', 'copy',
conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
org_value_dir = self.driver.configuration.gpfs_images_dir
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value_share_mode)
CONF.gpfs_images_dir = org_value_dir
self.override_config('gpfs_images_dir', org_value_dir,
conf.SHARED_CONF_GROUP)
# fail configuration.gpfs_images_share_mode == 'copy_on_write' and not
# _same_filesystem(configuration.gpfs_mount_point_base,
# 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')
self.override_config('gpfs_images_share_mode', 'copy_on_write',
conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs._same_filesystem',
return_value=False):
self.assertRaises(exception.VolumeBackendAPIException,
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
# not self._is_same_fileset(self.configuration.gpfs_mount_point_base,
# 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.'
'_is_same_fileset', return_value=False):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.check_for_setup_error)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value)
# fail directory is None
org_value_share_mode = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=None)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_images_share_mode', None,
conf.SHARED_CONF_GROUP)
org_value_dir = self.driver.configuration.gpfs_images_dir
self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level',
return_value=fake_cluster_release):
self.driver.check_for_setup_error()
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value_share_mode)
CONF.gpfs_images_dir = org_value_dir
self.override_config('gpfs_images_dir', org_value_dir,
conf.SHARED_CONF_GROUP)
# fail directory.startswith('/')
org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base='_' + self.volumes_path)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_mount_point_base', '_' + self.volumes_path,
conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_share_mode', None,
conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level',
return_value=fake_cluster_release):
self.assertRaises(exception.VolumeBackendAPIException,
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
self.override_config('gpfs_mount_point_base', org_value_mount,
conf.SHARED_CONF_GROUP)
# fail os.path.isdir(directory)
org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=self.volumes_path + '_')
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_mount_point_base', self.volumes_path + '_',
conf.SHARED_CONF_GROUP)
org_value_dir = self.driver.configuration.gpfs_images_dir
self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level',
return_value=fake_cluster_release):
self.assertRaises(exception.VolumeBackendAPIException,
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
self.override_config('gpfs_mount_point_base', org_value_mount,
conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_dir', org_value_dir,
conf.SHARED_CONF_GROUP)
# fail not cluster release level >= GPFS_CLONE_MIN_RELEASE
org_fake_cluster_release = fake_cluster_release
fake_cluster_release = 1105
org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=self.volumes_path)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_mount_point_base', self.volumes_path,
conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level',
return_value=fake_cluster_release):
@ -644,11 +634,9 @@ class GPFSDriverTestCase(test.TestCase):
# fail not fs release level >= GPFS_CLONE_MIN_RELEASE
org_fake_fs_release = fake_fs_release
fake_fs_release = 1105
org_value_mount = self.driver.configuration.gpfs_mount_point_base
self.flags(volume_driver=self.driver_name,
gpfs_mount_point_base=self.volumes_path)
org_value_dir = CONF.gpfs_images_dir
CONF.gpfs_images_dir = None
self.override_config('gpfs_mount_point_base', self.volumes_path,
conf.SHARED_CONF_GROUP)
self.override_config('gpfs_images_dir', None, conf.SHARED_CONF_GROUP)
with mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_get_gpfs_cluster_release_level',
return_value=fake_cluster_release):
@ -657,9 +645,6 @@ class GPFSDriverTestCase(test.TestCase):
return_value=(fake_fs, fake_fs_release)):
self.assertRaises(exception.VolumeBackendAPIException,
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
@mock.patch('cinder.utils.execute')
@ -698,20 +683,21 @@ class GPFSDriverTestCase(test.TestCase):
def test_set_volume_attributes_no_attributes(self, mock_change_attributes):
metadata = {}
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.flags(volume_driver=self.driver_name,
gpfs_storage_pool=org_value)
self.override_config('gpfs_storage_pool', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_gpfs_change_attributes')
def test_set_volume_attributes_no_options(self, mock_change_attributes):
metadata = {}
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.flags(volume_driver=self.driver_name,
gpfs_storage_pool=org_value)
self.override_config('gpfs_storage_pool', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -739,10 +725,11 @@ class GPFSDriverTestCase(test.TestCase):
value['value'] = 'test'
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.flags(volume_driver=self.driver_name,
gpfs_sparse_volumes=org_value)
self.override_config('gpfs_sparse_volumes', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -770,10 +757,11 @@ class GPFSDriverTestCase(test.TestCase):
value['value'] = 'test'
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.flags(volume_driver=self.driver_name,
gpfs_sparse_volumes=org_value)
self.override_config('gpfs_sparse_volumes', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -803,12 +791,13 @@ class GPFSDriverTestCase(test.TestCase):
metadata = {'fake_key': 'fake_value'}
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.assertTrue(self.driver._set_volume_attributes(volume, 'test',
metadata))
self.flags(volume_driver=self.driver_name,
gpfs_sparse_volumes=org_value)
self.override_config('gpfs_sparse_volumes', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file')
@ -991,48 +980,48 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.utils.execute')
def test_gpfs_redirect_ok(self, mock_exec):
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'
'------ ----- -------------- ---------\n'
' no 2 148488 '
'/gpfs0/test.txt', ''),
('', '')]
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'
'------ ----- -------------- ---------\n'
' no 1 148488 '
'/gpfs0/test.txt', ''),
('', '')]
self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name,
gpfs_max_clone_depth=org_value)
self.override_config('gpfs_max_clone_depth', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute')
def test_gpfs_redirect_fail_depth(self, mock_exec):
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'
'------ ----- -------------- ---------\n'
' no 2 148488 '
'/gpfs0/test.txt', ''),
('', '')]
self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name,
gpfs_max_clone_depth=org_value)
self.override_config('gpfs_max_clone_depth', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.utils.execute')
def test_gpfs_redirect_fail_match(self, mock_exec):
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'
'------ ----- -------------- ---------\n'
' 148488 '
'/gpfs0/test.txt', ''),
('', '')]
self.assertFalse(self.driver._gpfs_redirect(''))
self.flags(volume_driver=self.driver_name,
gpfs_max_clone_depth=org_value)
self.override_config('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_copy')
@ -1085,16 +1074,11 @@ class GPFSDriverTestCase(test.TestCase):
mock_set_rw_permission,
mock_gpfs_redirect,
mock_vol_get_by_id):
org_value = self.driver.configuration.gpfs_mount_point_base
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()
mock_vol_get_by_id.return_value = vol
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.volume.drivers.ibm.gpfs.GPFSDriver.'
@ -1184,8 +1168,10 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver._is_gpfs_path')
def test_is_cloneable_ok(self, mock_is_gpfs_path):
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy')
self.override_config('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
mock_is_gpfs_path.return_value = None
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')
def test_is_cloneable_fail_path(self, mock_is_gpfs_path):
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy')
self.override_config('gpfs_images_share_mode', 'copy',
conf.SHARED_CONF_GROUP)
CONF.gpfs_images_dir = self.images_dir
mock_is_gpfs_path.side_effect = (
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('')
volume = self._fake_volume()
org_value = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy_on_write')
self.override_config('gpfs_images_share_mode', 'copy_on_write',
conf.SHARED_CONF_GROUP)
self.assertEqual(({'provider_location': None}, True),
self.driver._clone_image(volume, '', 1))
mock_create_gpfs_snap.assert_called_once_with(self.images_dir)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value)
self.override_config('gpfs_images_share_mode', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file')
@ -1311,15 +1297,15 @@ class GPFSDriverTestCase(test.TestCase):
volume = self._fake_volume()
org_value = self.driver.configuration.gpfs_images_share_mode
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode='copy')
self.override_config('gpfs_images_share_mode', 'copy',
conf.SHARED_CONF_GROUP)
self.assertEqual(({'provider_location': None}, True),
self.driver._clone_image(volume, '', 1))
mock_copyfile.assert_called_once_with(self.images_dir,
self.volumes_path)
self.flags(volume_driver=self.driver_name,
gpfs_images_share_mode=org_value)
self.override_config('gpfs_images_share_mode', org_value,
conf.SHARED_CONF_GROUP)
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_resize_volume_file')

View File

@ -689,6 +689,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
def test_revert_snapshot(self):
self._setup_stubs_for_manage_existing()
self.configuration.lvm_type = 'auto'
fake_volume = tests_utils.create_volume(self.context,
display_name='fake_volume')
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_cache_directory = zfssa_cache_dir
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'
def test_setup_nfs_client(self):

View File

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

View File

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

View File

@ -31,6 +31,7 @@ from cinder.image import image_utils
from cinder import objects
from cinder.objects import fields
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver_utils
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import throttling
@ -295,6 +296,8 @@ iser_opts = [
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(iser_opts)
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 objects
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume import utils as volutils
@ -41,7 +42,7 @@ volume_opts = [
]
CONF = cfg.CONF
CONF.register_opts(volume_opts)
CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver

View File

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

View File

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

View File

@ -30,6 +30,7 @@ from cinder import context
from cinder import exception
from cinder.i18n import _
from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume.drivers.coprhd.helpers import (
authentication as coprhd_auth)
from cinder.volume.drivers.coprhd.helpers import (
@ -82,7 +83,7 @@ volume_opts = [
]
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_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.i18n import _
from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.coprhd import common as coprhd_common
@ -55,7 +56,7 @@ scaleio_opts = [
]
CONF = cfg.CONF
CONF.register_opts(scaleio_opts)
CONF.register_opts(scaleio_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver

View File

@ -24,6 +24,7 @@ import six
from cinder import exception
from cinder.i18n import _
from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san
import cinder.volume.drivers.datera.datera_api2 as api2
@ -70,7 +71,7 @@ d_opts = [
CONF = cfg.CONF
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)

View File

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

View File

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

View File

@ -41,6 +41,7 @@ from cinder import objects
from cinder import utils
from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.san import san
from cinder.volume import qos_specs
@ -89,7 +90,7 @@ scaleio_opts = [
'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_ID = 'sio:sp_id'

View File

@ -19,6 +19,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.dell_emc.unity import adapter
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. '
'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

View File

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

View File

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

View File

@ -49,6 +49,7 @@ from cinder.i18n import _
from cinder import interface
from cinder.objects import fields
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.san import san
from cinder.zonemanager import utils as fczm_utils
@ -72,7 +73,7 @@ XTREMIO_OPTS = [
default=100,
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()
OBJ_NOT_FOUND_ERR = 'obj_not_found'

View File

@ -31,6 +31,7 @@ from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.disco import disco_api
from cinder.volume.drivers.disco import disco_attach_detach
@ -99,7 +100,7 @@ DISCO_CODE_MAPPING = {
}
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

View File

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

View File

@ -39,6 +39,7 @@ from oslo_utils import units
from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver
try:
@ -108,7 +109,7 @@ drbd_opts = [
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"

View File

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

View File

@ -28,6 +28,7 @@ from xml.etree.ElementTree import parse
from cinder import exception
from cinder.i18n import _
from cinder.volume import configuration as conf
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
@ -134,7 +135,7 @@ RETCODE_dic = {
'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):

View File

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

View File

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

View File

@ -26,6 +26,7 @@ import six
from cinder import exception
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_horcm as horcm
from cinder.volume.drivers.hitachi import hbsd_snm2 as snm2
@ -89,7 +90,7 @@ volume_opts = [
]
CONF = cfg.CONF
CONF.register_opts(volume_opts)
CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)
class TryLock(object):

View File

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

View File

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

View File

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

View File

@ -33,6 +33,7 @@ from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
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_utils
from cinder.volume.drivers import nfs
@ -53,7 +54,7 @@ NFS_OPTS = [
]
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'}

View File

@ -27,6 +27,7 @@ from xml.etree import ElementTree as ETree
from cinder import exception
from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume import volume_types
LOG = logging.getLogger(__name__)
@ -83,7 +84,7 @@ drivers_common_opts = [
]
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):

View File

@ -26,6 +26,7 @@ import six
from cinder import coordination
from cinder import exception
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 import utils as volume_utils
@ -111,7 +112,7 @@ _REQUIRED_COMMON_OPTS = [
]
CONF = cfg.CONF
CONF.register_opts(common_opts)
CONF.register_opts(common_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__)
MSG = utils.VSPMsg

View File

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

View File

@ -32,6 +32,7 @@ from six.moves import range
from cinder import coordination
from cinder import exception
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_utils as utils
@ -223,7 +224,7 @@ _REQUIRED_HORCM_OPTS = [
]
CONF = cfg.CONF
CONF.register_opts(horcm_opts)
CONF.register_opts(horcm_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__)
MSG = utils.VSPMsg

View File

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

View File

@ -62,6 +62,7 @@ from cinder import exception
from cinder import flow_utils
from cinder.i18n import _
from cinder.objects import fields
from cinder.volume import configuration
from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
@ -128,7 +129,7 @@ hpe3par_opts = [
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.
THROUGHPUT = 'throughput'

View File

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

View File

@ -31,6 +31,7 @@ from cinder.i18n import _
from cinder import interface
from cinder.objects import fields
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.huawei import constants
from cinder.volume.drivers.huawei import fc_zone_helper
@ -72,7 +73,7 @@ huawei_opts = [
]
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')
Snapshot = collections.namedtuple('Snapshot', snap_attrs)

View File

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

View File

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

View File

@ -35,6 +35,7 @@ from cinder import exception
from cinder.i18n import _
from cinder import interface
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.san import san
@ -48,7 +49,7 @@ flashsystem_iscsi_opts = [
]
CONF = cfg.CONF
CONF.register_opts(flashsystem_iscsi_opts)
CONF.register_opts(flashsystem_iscsi_opts, group=conf.SHARED_CONF_GROUP)
@interface.volumedriver

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,6 +27,7 @@ from oslo_utils import units
from cinder import exception
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.san import san
from cinder.volume import volume_types
@ -79,8 +80,8 @@ infortrend_esds_extra_opts = [
]
CONF = cfg.CONF
CONF.register_opts(infortrend_esds_opts)
CONF.register_opts(infortrend_esds_extra_opts)
CONF.register_opts(infortrend_esds_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(infortrend_esds_extra_opts, group=conf.SHARED_CONF_GROUP)
CLI_RC_FILTER = {
'CreatePartition': {'error': _('Failed to create partition.')},

View File

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

View File

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

View File

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

View File

@ -29,6 +29,7 @@ from oslo_utils import units
from cinder import context
from cinder import exception
from cinder.i18n import _
from cinder.volume import configuration
from cinder.volume.drivers.nec import cli
from cinder.volume.drivers.san import san
from cinder.volume import qos_specs
@ -101,7 +102,7 @@ mstorage_opts = [
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):

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 types
from cinder.volume import configuration as conf
NETAPP_SIZE_MULTIPLIER_DEFAULT = 1.2
netapp_proxy_opts = [
@ -213,15 +215,15 @@ netapp_replication_opts = [
'during a failover.'), ]
CONF = cfg.CONF
CONF.register_opts(netapp_proxy_opts)
CONF.register_opts(netapp_connection_opts)
CONF.register_opts(netapp_transport_opts)
CONF.register_opts(netapp_basicauth_opts)
CONF.register_opts(netapp_cluster_opts)
CONF.register_opts(netapp_7mode_opts)
CONF.register_opts(netapp_provisioning_opts)
CONF.register_opts(netapp_img_cache_opts)
CONF.register_opts(netapp_eseries_opts)
CONF.register_opts(netapp_nfs_extra_opts)
CONF.register_opts(netapp_san_opts)
CONF.register_opts(netapp_replication_opts)
CONF.register_opts(netapp_proxy_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_connection_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_transport_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_basicauth_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_cluster_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_7mode_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_provisioning_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_img_cache_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_eseries_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_nfs_extra_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_san_opts, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(netapp_replication_opts, group=conf.SHARED_CONF_GROUP)

View File

@ -15,6 +15,7 @@
from oslo_config import cfg
from cinder.volume import configuration as conf
NEXENTA_EDGE_OPTS = [
cfg.StrOpt('nexenta_nbd_symlinks_dir',
@ -147,9 +148,9 @@ NEXENTA_RRMGR_OPTS = [
]
CONF = cfg.CONF
CONF.register_opts(NEXENTA_CONNECTION_OPTS)
CONF.register_opts(NEXENTA_ISCSI_OPTS)
CONF.register_opts(NEXENTA_DATASET_OPTS)
CONF.register_opts(NEXENTA_NFS_OPTS)
CONF.register_opts(NEXENTA_RRMGR_OPTS)
CONF.register_opts(NEXENTA_EDGE_OPTS)
CONF.register_opts(NEXENTA_CONNECTION_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_ISCSI_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_DATASET_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_NFS_OPTS, group=conf.SHARED_CONF_GROUP)
CONF.register_opts(NEXENTA_RRMGR_OPTS, group=conf.SHARED_CONF_GROUP)
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 import interface
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers import remotefs
@ -71,7 +72,7 @@ nfs_opts = [
]
CONF = cfg.CONF
CONF.register_opts(nfs_opts)
CONF.register_opts(nfs_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver
@ -96,12 +97,10 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed, driver.ExtendVD):
root_helper = utils.get_root_helper()
# base bound to instance is used in RemoteFsConnector.
self.base = getattr(self.configuration,
'nfs_mount_point_base',
CONF.nfs_mount_point_base)
'nfs_mount_point_base')
self.base = os.path.realpath(self.base)
opts = getattr(self.configuration,
'nfs_mount_options',
CONF.nfs_mount_options)
'nfs_mount_options')
nas_mount_options = getattr(self.configuration,
'nas_mount_options',

View File

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

View File

@ -16,6 +16,7 @@
from oslo_config import cfg
from cinder.volume import configuration
DPL_OPTS = [
cfg.StrOpt('dpl_pool',
@ -27,4 +28,4 @@ DPL_OPTS = [
]
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.objects import fields
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.san import san
from cinder.volume import utils as volume_utils
@ -82,7 +83,7 @@ PURE_OPTS = [
]
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]")
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.i18n import _
from cinder import interface
from cinder.volume import configuration
from cinder.volume.drivers.san import san
LOG = logging.getLogger(__name__)
@ -53,7 +54,7 @@ qnap_opts = [
]
CONF = cfg.CONF
CONF.register_opts(qnap_opts)
CONF.register_opts(qnap_opts, group=configuration.SHARED_CONF_GROUP)
@interface.volumedriver

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,6 +36,7 @@ from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
@ -52,7 +53,7 @@ sheepdog_opts = [
CONF = cfg.CONF
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):

View File

@ -39,6 +39,7 @@ from cinder.image import image_utils
from cinder import interface
from cinder.objects import fields
from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san
from cinder.volume import qos_specs
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.')]
CONF = cfg.CONF
CONF.register_opts(sf_opts)
CONF.register_opts(sf_opts, group=configuration.SHARED_CONF_GROUP)
# SolidFire API Error Constants
xExceededLimit = 'xExceededLimit'

View File

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

View File

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

View File

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

View File

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

View File

@ -39,6 +39,7 @@ from oslo_vmware import vim_util
from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.vmware import datastore as hub
from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions
@ -130,7 +131,7 @@ vmdk_opts = [
]
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,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,6 +28,7 @@ from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder import utils
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.san import san
from cinder.volume.drivers.zfssa import zfssarest
@ -91,7 +92,7 @@ ZFSSA_OPTS = [
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:volblocksize',

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