[virt-tools-list] [virt-manager PATCH] pylint: fix simplifiable-if-statement issue

Chen Hanxiao chen_han_xiao at 126.com
Wed Oct 10 06:44:00 UTC 2018


From: Chen Hanxiao <chenhanxiao at gmail.com>

pylint complain:
    The if statement can be replaced with 'var = bool(test)'

Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
---
 virtinst/guest.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/virtinst/guest.py b/virtinst/guest.py
index 2de4dc96..c89a4eac 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -604,10 +604,8 @@ class Guest(XMLBuilder):
         usb2 = False
         usb3 = False
         if self.os.is_x86():
-            if self.osinfo.supports_usb3() and qemu_usb3:
-                usb3 = True
-            else:
-                usb2 = True
+            usb3 = bool(self.osinfo.supports_usb3() and qemu_usb3)
+            usb2 = not usb3
         elif self.os.is_arm_machvirt():
             # For machvirt, we always assume OS supports usb3
             if (qemu_usb3 and
-- 
2.17.1




More information about the virt-tools-list mailing list