[virt-tools-list] [PATCH] addhardware: Fix typo in _set_disk_controller

Cole Robinson crobinso at redhat.com
Wed Dec 20 18:19:07 UTC 2017


On 11/24/2017 07:16 AM, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma at suse.com>
> ---
>  virtManager/addhardware.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> index e563fe6..8f39ee5 100644
> --- a/virtManager/addhardware.py
> +++ b/virtManager/addhardware.py
> @@ -1459,7 +1459,7 @@ class vmmAddHardware(vmmGObjectUI):
>              if (d.get_target_prefix() == disk.get_target_prefix() and
>                  d.bus == "scsi"):
>                  num = virtinst.VirtualDisk.target_to_num(d.target)
> -                idx = num // 7
> +                idx = num / 7
>                  if idx not in occupied:
>                      occupied[idx] = []
>                  if d.target not in occupied[idx]:
> 

This isn't actually a typo. // is floor division in python. // vs /
doesn't have any functional difference here for python2 but it will
cause issues when we switch to python3 (I only learned about this
recently too)

https://www.python.org/dev/peps/pep-0238/

Thanks,
Cole




More information about the virt-tools-list mailing list