use import_object_ns for compute_driver loading

Part of bp:virt-driver-cleanup

Convert to using import_object_ns which allows us
to import specific virt drivers as 'libvirt.LibvirtDriver'
instead of 'nova.virt.libvirt.libvirtDriver'.

Update testing to ensure this works with both short
names and long names (which need not be in the nova.virt
namespace).

Change-Id: I5eee3389c7719d5f361532b0eddaa249233283a5
This commit is contained in:
Sean Dague
2012-06-29 10:56:59 -04:00
parent 664b5767a8
commit 3042c50a09

View File

@@ -117,9 +117,13 @@ class VirtDriverLoaderTestCase(_FakeDriverBackendTestCase):
final class"""
# if your driver supports being tested in a fake way, it can go here
#
# both long form and short form drivers are supported
new_drivers = {
'nova.virt.fake.FakeDriver': 'FakeDriver',
'nova.virt.libvirt.LibvirtDriver': 'LibvirtDriver'
'nova.virt.libvirt.LibvirtDriver': 'LibvirtDriver',
'fake.FakeDriver': 'FakeDriver',
'libvirt.LibvirtDriver': 'LibvirtDriver'
}
# NOTE(sdague): remove after Folsom release when connection_type