cyborg/db/sqlalchemy/api.py
def reservation_commit(self, context, reservations, project_id=None):
        """Commit quota reservation to quota usage table"""
        with _session_for_write() as session:
            quota_usage = self._get_quota_usages(
                context, project_id,
                resources=self._get_reservation_resources(context,
                                                          reservations))
            usages = self._dict_with_usage_id(quota_usage)

            for reservation in self._quota_reservations(session, context,
                                                        reservations):

                usage = usages[reservation.usage_id]
                if reservation.delta >= 0:
                    usage.reserved -= reservation.delta
                usage.in_use += reservation.delta
                session.flush()
                reservation.delete(session=session)
Commit quota reservation to quota usage table
Commit quota reservation to quota usage table
Commit quota reservation to quota usage table
def reservation_commit(self, context, reservations, project_id=None):
        with _session_for_write() as session:
            quota_usage = self._get_quota_usages(
                context, project_id,
                resources=self._get_reservation_resources(context,
                                                          reservations))
            usages = self._dict_with_usage_id(quota_usage)
            for reservation in self._quota_reservations(session, context,
                                                        reservations):
                usage = usages[reservation.usage_id]
                if reservation.delta >= 0:
                    usage.reserved -= reservation.delta
                usage.in_use += reservation.delta
                session.flush()
                reservation.delete(session=session)
def reservation_commit ( self , context , reservations , project_id = None ) : with _session_for_write ( ) as session : quota_usage = self . _get_quota_usages ( context , project_id , resources = self . _get_reservation_resources ( context , reservations ) ) usages = self . _dict_with_usage_id ( quota_usage ) for reservation in self . _quota_reservations ( session , context , reservations ) : usage = usages [ reservation . usage_id ] if reservation . delta >= 0 : usage . reserved -= reservation . delta usage . in_use += reservation . delta session . flush ( ) reservation . delete ( session = session )
Commit quota reservation to quota usage table
Commit quota reservation to quota usage table
"""Commit quota reservation to quota usage table"""
self
context
reservations
project_id