components/openstack/keystone/patches/launchpad-1404354.patch
branchs11u2-sru
changeset 4156 4b1def16fe9b
equal deleted inserted replaced
4146:097063f324c0 4156:4b1def16fe9b
       
     1 commit 600c236e2111a770e478040a8a78bb62ef27ac39
       
     2 Author: Brant Knudson <[email protected]>
       
     3 Date:   Fri Dec 19 14:11:00 2014 -0600
       
     4 
       
     5     Fix to not use empty IN clause
       
     6     
       
     7     When an empty IN clause is used with sqlalchemy, a warning is
       
     8     printed:
       
     9     
       
    10      SAWarning: The IN-predicate on "assignment.actor_id" was invoked
       
    11      with an empty sequence. ...
       
    12     
       
    13     With this fix, these warnings should no longer be printed.
       
    14     
       
    15     The tests are changed to convert these warnings into errors.
       
    16     
       
    17     Change-Id: I58c7e5f11fdac9bbc1e9a970ce690ea113e2bd95
       
    18     Closes-Bug: #1404354
       
    19 
       
    20 --- keystone-2014.2.2/keystone/assignment/backends/sql.py.orig	2014-12-04 21:03:56.000000000 -0800
       
    21 +++ keystone-2014.2.2/keystone/assignment/backends/sql.py	2015-01-25 20:44:40.377007906 -0800
       
    22 @@ -356,6 +356,10 @@ class Assignment(keystone_assignment.Dri
       
    23 
       
    24      def _get_group_project_roles(self, session, groups, project_id,
       
    25                                   project_domain_id):
       
    26 +        if not groups:
       
    27 +            # If there's no groups then there will be no project roles.
       
    28 +            return []
       
    29 +
       
    30          sql_constraints = sqlalchemy.and_(
       
    31              RoleAssignment.type == AssignmentType.GROUP_PROJECT,
       
    32              RoleAssignment.target_id == project_id)