inconsistent context requirements in DB API
Bug #1580690 reported by
Tom Barron
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/
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.
Changed in manila: | |
assignee: | nobody → Tom Barron (tpb) |
Changed in manila: | |
status: | New → In Progress |
Changed in manila: | |
importance: | Undecided → Low |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/314996 /git.openstack. org/cgit/ openstack/ manila/ commit/ ?id=896acf42d44 ac618241cef5787 8556176207fa0e
Committed: https:/
Submitter: Jenkins
Branch: master
commit 896acf42d44ac61 8241cef57878556 176207fa0e
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
requirement decorators.
and public methods should not.
2. All public methods should have appropriate context
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: Ic448d40ef83a02 837dd9bc2c64650 80387305ca1