Change LibvirtDriver.capabilities to an instance variable
Since at least one libvirt capability is already dynamic due to
depending on support being present in QEMU and libvirt, change the
LibvirtDriver.capabilities dictionary from a class variable to an
instance variable. This prevents the risk of one test setting a
capability which bleeds over into other tests, in the same way it was
already done in the PowerVM driver:
cc7564549a
Change-Id: Ic4c16b23834b43a258be5073e32bcdb9c0421f02
This commit is contained in:
@@ -295,22 +295,25 @@ VGPU_RESOURCE_SEMAPHORE = "vgpu_resources"
|
||||
|
||||
|
||||
class LibvirtDriver(driver.ComputeDriver):
|
||||
capabilities = {
|
||||
"has_imagecache": True,
|
||||
"supports_evacuate": True,
|
||||
"supports_migrate_to_same_host": False,
|
||||
"supports_attach_interface": True,
|
||||
"supports_device_tagging": True,
|
||||
"supports_tagged_attach_interface": True,
|
||||
"supports_tagged_attach_volume": True,
|
||||
"supports_extend_volume": True,
|
||||
# Multiattach support is conditional on qemu and libvirt versions
|
||||
# determined in init_host.
|
||||
"supports_multiattach": False,
|
||||
"supports_trusted_certs": True,
|
||||
}
|
||||
|
||||
def __init__(self, virtapi, read_only=False):
|
||||
# NOTE(aspiers) Some of these are dynamic, so putting
|
||||
# capabilities on the instance rather than on the class.
|
||||
# This prevents the risk of one test setting a capability
|
||||
# which bleeds over into other tests.
|
||||
self.capabilities = {
|
||||
"has_imagecache": True,
|
||||
"supports_evacuate": True,
|
||||
"supports_migrate_to_same_host": False,
|
||||
"supports_attach_interface": True,
|
||||
"supports_device_tagging": True,
|
||||
"supports_tagged_attach_interface": True,
|
||||
"supports_tagged_attach_volume": True,
|
||||
"supports_extend_volume": True,
|
||||
# Multiattach support is conditional on qemu and libvirt versions
|
||||
# determined in init_host.
|
||||
"supports_multiattach": False,
|
||||
"supports_trusted_certs": True,
|
||||
}
|
||||
super(LibvirtDriver, self).__init__(virtapi)
|
||||
|
||||
global libvirt
|
||||
|
||||
Reference in New Issue
Block a user