inconsistent context requirements in DB API

Bug #1580690 reported by Tom Barron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Tom Barron

Bug Description

The sqlalchemy API has decorators to require a context or admin context argument to its DB methods but these are inconsistently applied today.

Some public methods in db/sqlalchemy/api.py have context argument but lack decorators.

A number of private methods have decorators but these are redundant and wasteful if all public methods were appropriately decorated.

Some unit tests for public methods do not pass a context when they should.

Tom Barron (tpb)
Changed in manila:
assignee: nobody → Tom Barron (tpb)
Changed in manila:
status: New → In Progress
Changed in manila:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/314996
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=896acf42d44ac618241cef57878556176207fa0e
Submitter: Jenkins
Branch: master

commit 896acf42d44ac618241cef57878556176207fa0e
Author: Tom Barron <email address hidden>
Date: Tue May 10 11:29:51 2016 -0400

    Fix context decorator usage in DB API

    Manila's sqlalchemy API has decorators to require
    a context or admin context argument to its DB
    methods.

    Add missing context-check decorators where context
    argument is required in accord with the following
    principles:

      1. Private methods should begin with underscore and
         and public methods should not.
      2. All public methods should have appropriate context
         requirement decorators.
      3. No private methods have context requirement
         decorators since these are redundant if
         principle #2 is enforced.

    Correct unit tests that inappropriately called these
    methods without context as well.

    Closes-Bug: #1580690

    Change-Id: Ic448d40ef83a02837dd9bc2c6465080387305ca1

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/manila 3.0.0.0b1

This issue was fixed in the openstack/manila 3.0.0.0b1 development milestone.

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.