remove deprecated connection_type flag
Fixes bug #1025712 connection_type was deprecated in Folsom and should now be removed in Grizzly as early as possible to shake out any fallout. This removes all references to it, changes the config sample and tests appropriately. Remove old default fixtures for flavors that specify ephemeral disks if the connection_type flag was set to 'libvirt' Change-Id: I8af831600a1931ae92c6d06c5105bd1bd81debe3
This commit is contained in:
@@ -74,10 +74,6 @@ def _get_my_ip():
|
|||||||
|
|
||||||
|
|
||||||
core_opts = [
|
core_opts = [
|
||||||
cfg.StrOpt('connection_type',
|
|
||||||
default=None,
|
|
||||||
help='Deprecated (use compute_driver instead): Virtualization '
|
|
||||||
'api connection type : libvirt, xenapi, or fake'),
|
|
||||||
cfg.StrOpt('sql_connection',
|
cfg.StrOpt('sql_connection',
|
||||||
default='sqlite:///$state_path/$sqlite_db',
|
default='sqlite:///$state_path/$sqlite_db',
|
||||||
help='The SQLAlchemy connection string used to connect to the '
|
help='The SQLAlchemy connection string used to connect to the '
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ flags.DECLARE('volume_driver', 'nova.volume.manager')
|
|||||||
def set_defaults(conf):
|
def set_defaults(conf):
|
||||||
conf.set_default('api_paste_config', '$state_path/etc/nova/api-paste.ini')
|
conf.set_default('api_paste_config', '$state_path/etc/nova/api-paste.ini')
|
||||||
conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
|
conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
|
||||||
conf.set_default('connection_type', 'fake')
|
|
||||||
conf.set_default('fake_network', True)
|
conf.set_default('fake_network', True)
|
||||||
conf.set_default('fake_rabbit', True)
|
conf.set_default('fake_rabbit', True)
|
||||||
conf.set_default('flat_network_bridge', 'br100')
|
conf.set_default('flat_network_bridge', 'br100')
|
||||||
|
|||||||
@@ -144,13 +144,6 @@ class VirtDriverLoaderTestCase(_FakeDriverBackendTestCase):
|
|||||||
'libvirt.LibvirtDriver': 'LibvirtDriver'
|
'libvirt.LibvirtDriver': 'LibvirtDriver'
|
||||||
}
|
}
|
||||||
|
|
||||||
# NOTE(sdague): remove after Folsom release when connection_type
|
|
||||||
# is removed
|
|
||||||
old_drivers = {
|
|
||||||
'libvirt': 'LibvirtDriver',
|
|
||||||
'fake': 'FakeDriver'
|
|
||||||
}
|
|
||||||
|
|
||||||
def test_load_new_drivers(self):
|
def test_load_new_drivers(self):
|
||||||
for cls, driver in self.new_drivers.iteritems():
|
for cls, driver in self.new_drivers.iteritems():
|
||||||
self.flags(compute_driver=cls)
|
self.flags(compute_driver=cls)
|
||||||
@@ -164,28 +157,6 @@ class VirtDriverLoaderTestCase(_FakeDriverBackendTestCase):
|
|||||||
self.assertEqual(cm.driver.__class__.__name__, driver,
|
self.assertEqual(cm.driver.__class__.__name__, driver,
|
||||||
"Could't load driver %s" % cls)
|
"Could't load driver %s" % cls)
|
||||||
|
|
||||||
# NOTE(sdague): remove after Folsom release when connection_type
|
|
||||||
# is removed
|
|
||||||
def test_load_old_drivers(self):
|
|
||||||
# we explicitly use the old default
|
|
||||||
self.flags(compute_driver='nova.virt.connection.get_connection')
|
|
||||||
for cls, driver in self.old_drivers.iteritems():
|
|
||||||
self.flags(connection_type=cls)
|
|
||||||
# NOTE(sdague) the try block is to make it easier to debug a
|
|
||||||
# failure by knowing which driver broke
|
|
||||||
try:
|
|
||||||
cm = ComputeManager()
|
|
||||||
except Exception as e:
|
|
||||||
self.fail("Couldn't load connection %s - %s" % (cls, e))
|
|
||||||
|
|
||||||
self.assertEqual(cm.driver.__class__.__name__, driver,
|
|
||||||
"Could't load connection %s" % cls)
|
|
||||||
|
|
||||||
def test_fail_to_load_old_drivers(self):
|
|
||||||
self.flags(compute_driver='nova.virt.connection.get_connection')
|
|
||||||
self.flags(connection_type='56kmodem')
|
|
||||||
self.assertRaises(exception.VirtDriverNotFound, ComputeManager)
|
|
||||||
|
|
||||||
def test_fail_to_load_new_drivers(self):
|
def test_fail_to_load_new_drivers(self):
|
||||||
self.flags(compute_driver='nova.virt.amiga')
|
self.flags(compute_driver='nova.virt.amiga')
|
||||||
|
|
||||||
|
|||||||
@@ -1957,8 +1957,7 @@ class XenAPIAggregateTestCase(stubs.XenAPITestBase):
|
|||||||
firewall_driver='nova.virt.xenapi.firewall.'
|
firewall_driver='nova.virt.xenapi.firewall.'
|
||||||
'Dom0IptablesFirewallDriver',
|
'Dom0IptablesFirewallDriver',
|
||||||
host='host',
|
host='host',
|
||||||
connection_type='xenapi',
|
compute_driver='xenapi.XenAPIDriver')
|
||||||
compute_driver='nova.virt.xenapi.driver.XenAPIDriver')
|
|
||||||
host_ref = xenapi_fake.get_all('host')[0]
|
host_ref = xenapi_fake.get_all('host')[0]
|
||||||
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
|
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
|
||||||
self.context = context.get_admin_context()
|
self.context = context.get_admin_context()
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class XenSMTestCase(stubs.XenAPITestBase):
|
|||||||
self.user_id = 'fake'
|
self.user_id = 'fake'
|
||||||
self.project_id = 'fake'
|
self.project_id = 'fake'
|
||||||
self.context = context.RequestContext(self.user_id, self.project_id)
|
self.context = context.RequestContext(self.user_id, self.project_id)
|
||||||
self.flags(connection_type='xenapi',
|
self.flags(compute_driver='xenapi.XenAPIDriver',
|
||||||
xenapi_connection_url='http://test_url',
|
xenapi_connection_url='http://test_url',
|
||||||
xenapi_connection_username='test_user',
|
xenapi_connection_username='test_user',
|
||||||
xenapi_connection_password='test_pass')
|
xenapi_connection_password='test_pass')
|
||||||
|
|||||||
Reference in New Issue
Block a user