Merge "Fixed method db.api.reservation_expire"

This commit is contained in:
Jenkins 2013-06-02 17:10:34 +00:00 committed by Gerrit Code Review
commit a003e4a41f
2 changed files with 6 additions and 1 deletions

View File

@ -245,6 +245,12 @@ class Reservation(BASE, CinderBase):
delta = Column(Integer) delta = Column(Integer)
expire = Column(DateTime, nullable=False) expire = Column(DateTime, nullable=False)
usage = relationship(
"QuotaUsage",
foreign_keys=usage_id,
primaryjoin='and_(Reservation.usage_id == QuotaUsage.id,'
'QuotaUsage.deleted == 0)')
class Snapshot(BASE, CinderBase): class Snapshot(BASE, CinderBase):
"""Represents a block storage device that can be attached to a VM.""" """Represents a block storage device that can be attached to a VM."""

View File

@ -443,7 +443,6 @@ class DBAPIReservationTestCase(BaseTest):
self.assertEqual(expected, db.quota_usage_get_all_by_project( self.assertEqual(expected, db.quota_usage_get_all_by_project(
self.ctxt, 'project1')) self.ctxt, 'project1'))
@test.testtools.skip("bug 1185325")
def test_reservation_expire(self): def test_reservation_expire(self):
self.values['expire'] = datetime.utcnow() + timedelta(days=1) self.values['expire'] = datetime.utcnow() + timedelta(days=1)
reservations = _quota_reserve(self.ctxt, 'project1') reservations = _quota_reserve(self.ctxt, 'project1')