Merge lp://staging/~rackspace-titan/nova/osapi-servers-cleanup-p1 into lp://staging/~hudson-openstack/nova/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~rackspace-titan/nova/osapi-servers-cleanup-p1 |
Merge into: | lp://staging/~hudson-openstack/nova/trunk |
Diff against target: |
771 lines (+199/-197) 6 files modified
nova/api/openstack/__init__.py (+1/-1) nova/api/openstack/create_instance_helper.py (+5/-5) nova/api/openstack/servers.py (+174/-185) nova/api/openstack/views/servers.py (+6/-3) nova/api/openstack/wsgi.py (+10/-0) nova/tests/api/openstack/test_servers.py (+3/-3) |
To merge this branch: | bzr merge lp://staging/~rackspace-titan/nova/osapi-servers-cleanup-p1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Waldon | Pending | ||
Review via email: mp+64993@code.staging.launchpad.net |
Commit message
Code cleanup and refactoring of OSAPI servers code.
Description of the change
In order to prepare for this BP: https:/
When I learn about code I tend to do the following:
-Look for generically named functions and rename them
-Abstract out oftenly used and/or repeated functions
-Look over all tests to make sure they make sense (but don't make major modifications to tests at the same time as refactoring!)
With that being said, I have updated servers.py in the OSAPI to move helper methods to the top of the class, improve their naming, improve code readability (in my opinion), and prepare for the aforementioned query efficiency improvements.
Unmerged revisions
- 1187. By Brian Lamar
-
Clean-up, pep8 fixes, and minor HTTP status code changes.
PEP8 fixes: 8-9, 39-40, 48-49
Explanation in exceptions: 21-22, 30-31, 56-57, 151,
Return-code fixes: 601-602, 605-606, 657-658, 661-662, these return codes didn't make sense in their current form. If you're missing 'flavorId' is a bad request, not an unprocessable entity.
I've also added "request.context" and "request. reservation_ id" to the wsgi.Request object, which accounts for a good deal of this MP.
It's a pretty big prop, and I wanted to make it smaller, so let me know if you think I should remove some things or do it differently.