for division not accurate division

Bug #1689269 reported by jianfeng zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
Fix Released
Undecided
jianfeng zhang

Bug Description

for workload_balance strategy

when choice host
code is like

(src_instance_workload + workload) < self.threshold / 100 * host.vcpus)

by default ‘/’ will be 0 so cannot get avaialbe host

so we should use accurate division

by ‘from __future__ import division’

Changed in watcher:
assignee: nobody → jianfeng zhang (zhangjianfeng)
status: New → In Progress
Revision history for this message
jianfeng zhang (zhangjianfeng) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to watcher (master)

Reviewed: https://review.openstack.org/463296
Committed: https://git.openstack.org/cgit/openstack/watcher/commit/?id=2b152bf17c5c12b722d01c9711c57e78261be784
Submitter: Jenkins
Branch: master

commit 2b152bf17c5c12b722d01c9711c57e78261be784
Author: zhangjianfeng <kill51216@163.com>
Date: Mon May 8 18:23:40 2017 +0800

    [bugfix]for division use accurate division

    for now / just get int value ,this will lead method
    filter_destination_hosts return 0 host
    because self.threshold / 100 * host.vcpus is 0
    so we need use accurate division to change this

    close-bug: 1689269

    Change-Id: I5663951ce750d6c4580a507ccfc0268baea0685f

Changed in watcher:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.