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

Cole Robinson crobinso at redhat.com
Thu Oct 11 15:24:35 UTC 2018


On 10/10/2018 02:44 AM, Chen Hanxiao wrote:
> 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
> 

Thanks, pushed now

- Cole




More information about the virt-tools-list mailing list