diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-09-05 22:09:22 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-09-05 22:09:22 +0000 |
| commit | 06dec8ec1e518c33d00df2e88ffea92cf236a8dc (patch) | |
| tree | e83662afe0eb428e2ebec3c965de42a55fd61c11 /nova/api | |
| parent | 1ca3d8d15e560076d8e620fd7f61529f0fb2d000 (diff) | |
| parent | 869443f41c8826c9a4de1dcc65c5a5354b623a04 (diff) | |
Merge "Fix simple_tenant_usage's handing of future end times"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/simple_tenant_usage.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/contrib/simple_tenant_usage.py b/nova/api/openstack/compute/contrib/simple_tenant_usage.py index 75a3ddfc1..ee7924dec 100644 --- a/nova/api/openstack/compute/contrib/simple_tenant_usage.py +++ b/nova/api/openstack/compute/contrib/simple_tenant_usage.py @@ -218,6 +218,9 @@ class SimpleTenantUsageController(object): authorize_list(context) (period_start, period_stop, detailed) = self._get_datetime_range(req) + now = timeutils.utcnow() + if period_stop > now: + period_stop = now usages = self._tenant_usages_for_period(context, period_start, period_stop, @@ -233,6 +236,9 @@ class SimpleTenantUsageController(object): authorize_show(context, {'project_id': tenant_id}) (period_start, period_stop, ignore) = self._get_datetime_range(req) + now = timeutils.utcnow() + if period_stop > now: + period_stop = now usage = self._tenant_usages_for_period(context, period_start, period_stop, |
