Merge "libvirt: Drop MIN_LIBVIRT_PARALLELS_SET_ADMIN_PASSWD"

This commit is contained in:
Zuul 2019-02-23 09:22:40 +00:00 committed by Gerrit Code Review
commit 991b2bde39
2 changed files with 3 additions and 12 deletions

View File

@ -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)

View File

@ -233,9 +233,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)
@ -2059,14 +2056,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.