Exemple #1
0
    def commit(self, context, reservations, project_id=None, user_id=None,
               share_type_id=None):
        """Commit reservations.

        :param context: The request context, for access checks.
        :param reservations: A list of the reservation UUIDs, as
                             returned by the reserve() method.
        :param project_id: Specify the project_id if current context
                           is admin and admin wants to impact on
                           common user's tenant.
        :param user_id: Specify the user_id if current context
                        is admin and admin wants to impact on
                        common user. (Special case: user operates on
                        resource, owned/created by different user)
        """
        # If project_id is None, then we use the project_id in context
        if project_id is None:
            project_id = context.project_id
        # If user_id is None, then we use the user_id in context
        if user_id is None:
            user_id = context.user_id

        db.reservation_commit(
            context, reservations, project_id=project_id, user_id=user_id,
            share_type_id=share_type_id)
Exemple #2
0
    def commit(self, context, reservations, project_id=None, user_id=None,
               share_type_id=None):
        """Commit reservations.

        :param context: The request context, for access checks.
        :param reservations: A list of the reservation UUIDs, as
                             returned by the reserve() method.
        :param project_id: Specify the project_id if current context
                           is admin and admin wants to impact on
                           common user's tenant.
        :param user_id: Specify the user_id if current context
                        is admin and admin wants to impact on
                        common user. (Special case: user operates on
                        resource, owned/created by different user)
        """
        # If project_id is None, then we use the project_id in context
        if project_id is None:
            project_id = context.project_id
        # If user_id is None, then we use the user_id in context
        if user_id is None:
            user_id = context.user_id

        db.reservation_commit(
            context, reservations, project_id=project_id, user_id=user_id,
            share_type_id=share_type_id)