Merge "Make 'noop' the explicit default of default_storage_interface"
This commit is contained in:
commit
1b68717964
@ -131,15 +131,9 @@ def default_interface(hw_type, interface_type,
|
||||
:raises: NoValidDefaultForInterface if no default interface can be found.
|
||||
"""
|
||||
factory = _INTERFACE_LOADERS[interface_type]
|
||||
# Explicit interface defaults
|
||||
additional_defaults = {
|
||||
'storage': 'noop'
|
||||
}
|
||||
|
||||
# The fallback default from the configuration
|
||||
impl_name = getattr(CONF, 'default_%s_interface' % interface_type)
|
||||
if impl_name is None:
|
||||
impl_name = additional_defaults.get(interface_type)
|
||||
|
||||
if impl_name is not None:
|
||||
# Check that the default is correct for this type
|
||||
|
@ -151,6 +151,7 @@ driver_opts = [
|
||||
default=['cinder', 'noop'],
|
||||
help=_ENABLED_IFACE_HELP.format('storage')),
|
||||
cfg.StrOpt('default_storage_interface',
|
||||
default='noop',
|
||||
help=_DEFAULT_IFACE_HELP.format('storage')),
|
||||
cfg.ListOpt('enabled_vendor_interfaces',
|
||||
default=['ipmitool', 'no-vendor'],
|
||||
|
@ -131,6 +131,8 @@ class TestCase(oslo_test_base.BaseTestCase):
|
||||
self.config(enabled_hardware_types=['fake-hardware',
|
||||
'manual-management'])
|
||||
for iface in drivers_base.ALL_INTERFACES:
|
||||
default = None
|
||||
|
||||
# Restore some reasonable defaults
|
||||
if iface == 'network':
|
||||
values = ['flat', 'noop', 'neutron']
|
||||
@ -142,12 +144,13 @@ class TestCase(oslo_test_base.BaseTestCase):
|
||||
elif iface == 'boot':
|
||||
values.append('pxe')
|
||||
elif iface == 'storage':
|
||||
default = 'noop'
|
||||
values.append('noop')
|
||||
elif iface not in {'network', 'power', 'management'}:
|
||||
values.append('no-%s' % iface)
|
||||
|
||||
self.config(**{'enabled_%s_interfaces' % iface: values,
|
||||
'default_%s_interface' % iface: None})
|
||||
'default_%s_interface' % iface: default})
|
||||
self.set_defaults(host='fake-mini',
|
||||
debug=True)
|
||||
self.set_defaults(connection="sqlite://",
|
||||
|
Loading…
Reference in New Issue
Block a user