simple_tenant_usage returns the usage in the range between the supplied
start and end query parameters. The _hours_for() method calculates the
number of hours the instance was running in this range, even if the end time
is in the future.
By default, python-novaclient requests usage between 4 weeks ago and tomorrow.
This means we a report which accounts for 24 hours of extra running time for
each currently running instance. Fix this by clamping the period of the
returned report at the current time.
Reviewed: https:/ /review. openstack. org/12304 github. com/openstack/ nova/commit/ 869443f41c8826c 9a4de1dcc65c5a5 354b623a04
Committed: http://
Submitter: Jenkins
Branch: master
commit 869443f41c8826c 9a4de1dcc65c5a5 354b623a04
Author: RongzeZhu <email address hidden>
Date: Sun Sep 2 18:43:56 2012 +0800
Fix simple_ tenant_ usage's handing of future end times
Fixes bug #1043999
simple_ tenant_ usage returns the usage in the range between the supplied
start and end query parameters. The _hours_for() method calculates the
number of hours the instance was running in this range, even if the end time
is in the future.
By default, python-novaclient requests usage between 4 weeks ago and tomorrow.
This means we a report which accounts for 24 hours of extra running time for
each currently running instance. Fix this by clamping the period of the
returned report at the current time.
Change-Id: I61c211fd85b729 aaeaac6ef24644e e19eb5bb6b0