]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Unity the comparison of hw_qemu_guest_agent
authortianmaofu <tianmaofu@126.com>
Tue, 6 Dec 2016 08:40:27 +0000 (08:40 +0000)
committertianmaofu <tianmaofu@126.com>
Tue, 6 Dec 2016 08:51:11 +0000 (08:51 +0000)
The type of hw_qemu_guest_agent is Boolean, so there is
unnecessary to use bool_from_string.

Change-Id: I4101f806a259714383c144342e9c05722c8d888f

nova/virt/libvirt/driver.py

index 165346a8e238d5f87b3bea57694bf0e106bea841..03879002b73f32c865ad4e887b2a2e63abecfaa9 100644 (file)
@@ -1645,8 +1645,7 @@ class LibvirtDriver(driver.ComputeDriver):
             if not self._host.has_min_version(
                    MIN_LIBVIRT_SET_ADMIN_PASSWD):
                 raise exception.SetAdminPasswdNotSupported()
-            hw_qga = image_meta.properties.get('hw_qemu_guest_agent', '')
-            if not strutils.bool_from_string(hw_qga):
+            if not image_meta.properties.get('hw_qemu_guest_agent', False):
                 raise exception.QemuGuestAgentNotEnabled()
         else:
             raise exception.SetAdminPasswdNotSupported()