get_user has different behavior for db and ldap drivers

Bug #744462 reported by Devin Carlen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya

Bug Description

The db auth driver raises NotFound if a user lookup fails, while ldap auth driver returns None.

This inconsistency needs to be fixed, and causes problems further down the line and forces developers to awkwardly handle both scenarios.

Changed in nova:
assignee: nobody → Joe Pawlak (jpawlak1)
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Confirmed
Revision history for this message
Mark McLoughlin (markmc) wrote :

Looks like it's still a problem

e.g. LdapDriver.get_user() should raise UserNotFound if __get_ldap_user() returns None

tags: added: low-hanging-fruit
Changed in nova:
status: Confirmed → In Progress
assignee: nobody → Andrew Clay Shafer (littleidea)
Changed in nova:
assignee: Andrew Clay Shafer (littleidea) → nobody
Changed in nova:
assignee: nobody → John Griffith (john-griffith)
Revision history for this message
John Griffith (john-griffith) wrote :

Fairly straightforward to change in ldapdriver.py, but look out when you try and run the test_auth.py tests!!! Trying to figure out the issue, adding "assertRaises()" doesn't seem to be working out.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
John Griffith (john-griffith) wrote :

Submitted to gerrit for review Change-Id: Ia13af759931ca0c7327d54184730537bafbe52ae

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
status: Fix Committed → In Progress
Changed in nova:
assignee: John Griffith (john-griffith) → Vish Ishaya (vishvananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/3741
Committed: http://github.com/openstack/nova/commit/fa295d1278ef43fe2e90902006a5d073d78173ad
Submitter: Jenkins
Branch: master

commit fa295d1278ef43fe2e90902006a5d073d78173ad
Author: john-griffith <email address hidden>
Date: Thu Feb 2 22:15:58 2012 -0700

    get_user behavior in ldapdriver

    * Addresses bug 744462

    Rather than ldapdriver.get_user() returning None for non-existent
    user, this change implements exception.LDAPUserNotFound to more
    closely match the behavior of other drivers (db).

    Change was made in public method only, and _check_user_exists()
    which uses get_user() now catches and returns None if applicable.
    Implemented test of NotFound exception in base auth test class.

    Change-Id: Ia13af759931ca0c7327d54184730537bafbe52ae

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-4 → 2012.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.