SQLAlchemy driver fails in get_meter_statistics when the EventFilter has the 'end' parameter set

Bug #1132732 reported by Stas Maksimov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Julien Danjou

Bug Description

Sample test code:

    def test_by_user_period2(self):
        f = storage.EventFilter(
            user='user-5',
            meter='volume.size',
            start='2012-09-25T10:28:00',
            end='2012-09-25T11:28:00',
            )
        results = self.conn.get_meter_statistics(f, period=1800)
        self.assertEqual(len(results), 2)

Traceback (most recent call last):
  File "/home/stas/Cloud/ceilometer/tests/storage/base.py", line 775, in test_by_user_period2
    results = self.conn.get_meter_statistics(f, period=1800)
  File "/home/stas/Cloud/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 451, in get_meter_statistics
    + datetime.timedelta(seconds=i * period))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'

Tags: database
Julien Danjou (jdanjou)
Changed in ceilometer:
assignee: nobody → Julien Danjou (jdanjou)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/22869

Changed in ceilometer:
status: Confirmed → In Progress
Julien Danjou (jdanjou)
Changed in ceilometer:
milestone: none → grizzly-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/22869
Committed: http://github.com/openstack/ceilometer/commit/05e82be3afffb255073abb6c60bc133563d958e8
Submitter: Jenkins
Branch: master

commit 05e82be3afffb255073abb6c60bc133563d958e8
Author: Julien Danjou <email address hidden>
Date: Mon Feb 25 15:08:34 2013 +0100

    Fix statistics period computing with start/end time

    This fixes bug #1132732

    Change-Id: I97545340ad9f49ec575e27c1a4fb4a09a3aefbf4
    Signed-off-by: Julien Danjou <email address hidden>

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: grizzly-rc1 → 2013.1
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.