libvirt: Drop MIN_LIBVIRT_PARALLELS_SET_ADMIN_PASSWD
The updated minimum required libvirt (3.0.0) and QEMU (2.8.0) for "Stein" matches this now, so we can drop the compatibility code. Also remove / fix relevant unit tests. Change-Id: I194aad7c8e016bad33d51fa39ccab3bf0040d154 Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
This commit is contained in:
parent
da53afc1d8
commit
fe88d9e2c3
@ -1461,10 +1461,8 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||
instance.system_metadata['password_0'])
|
||||
mock_save.assert_called_once_with()
|
||||
|
||||
@mock.patch.object(host.Host,
|
||||
'has_min_version', return_value=True)
|
||||
@mock.patch('nova.virt.libvirt.host.Host.get_guest')
|
||||
def test_set_admin_password_parallels(self, mock_get_guest, ver):
|
||||
def test_set_admin_password_parallels(self, mock_get_guest):
|
||||
self.flags(virt_type='parallels', group='libvirt')
|
||||
instance = objects.Instance(**self.test_instance)
|
||||
mock_guest = mock.Mock(spec=libvirt_guest.Guest)
|
||||
|
@ -234,9 +234,6 @@ NEXT_MIN_QEMU_VERSION = (2, 11, 0)
|
||||
# Virtuozzo driver support
|
||||
MIN_VIRTUOZZO_VERSION = (7, 0, 0)
|
||||
|
||||
# Ability to set the user guest password with parallels
|
||||
MIN_LIBVIRT_PARALLELS_SET_ADMIN_PASSWD = (2, 0, 0)
|
||||
|
||||
# aarch64 architecture with KVM
|
||||
# 'chardev' support got sorted out in 3.6.0
|
||||
MIN_LIBVIRT_KVM_AARCH64_VERSION = (3, 6, 0)
|
||||
@ -2060,14 +2057,10 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
|
||||
def _can_set_admin_password(self, image_meta):
|
||||
|
||||
if CONF.libvirt.virt_type == 'parallels':
|
||||
if not self._host.has_min_version(
|
||||
MIN_LIBVIRT_PARALLELS_SET_ADMIN_PASSWD):
|
||||
raise exception.SetAdminPasswdNotSupported()
|
||||
elif CONF.libvirt.virt_type in ('kvm', 'qemu'):
|
||||
if CONF.libvirt.virt_type in ('kvm', 'qemu'):
|
||||
if not image_meta.properties.get('hw_qemu_guest_agent', False):
|
||||
raise exception.QemuGuestAgentNotEnabled()
|
||||
else:
|
||||
elif not CONF.libvirt.virt_type == 'parallels':
|
||||
raise exception.SetAdminPasswdNotSupported()
|
||||
|
||||
# TODO(melwitt): Combine this with the similar xenapi code at some point.
|
||||
|
Loading…
x
Reference in New Issue
Block a user