Move API V1 root controller logic from __init__ to the dedicated file
Bug #1255954 reported by
Max Lobur
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Fix Released
|
Low
|
Jim Rollenhagen |
Bug Description
1. Currently there is inconsistency in controller class location. F.e. this is the root controller class, placed in root.py :
https:/
And this is the V1 root controller placed in __init__.py
https:/
Tests from V1 root placed in https:/
2. Root controller (api/controller
Need to make this stuff consistent, as an option move V1 to /v1/root.py, make v1 dir in tests and move V1 tests there and so on
description: | updated |
description: | updated |
Changed in ironic: | |
assignee: | Max Lobur (max-lobur) → nobody |
assignee: | nobody → Matt Wagner (matt-wagner) |
Changed in ironic: | |
assignee: | nobody → ramesh (rameshg87) |
Changed in ironic: | |
assignee: | Ramakrishnan G (rameshg87) → Jim Rollenhagen (jim-rollenhagen) |
Changed in ironic: | |
status: | In Progress → Fix Committed |
Changed in ironic: | |
milestone: | none → icehouse-rc1 |
status: | Fix Committed → Fix Released |
Changed in ironic: | |
milestone: | icehouse-rc1 → 2014.1 |
To post a comment you must log in.
You raise some good points.
ironic. api.controllers .root is the root '/' controller imported by Pecan. This must import and instantiate a controller for each version of API that we support, and expose them in the root.RootController class. However, it shouldn't depend on any content defined within any particular version for its basic functionality. For example, in ironic/ api/controllers /root.py:
26 from ironic. api.controllers .v1 import base api.controllers .v1 import link base.APIBase) :
27 from ironic.
...
30 class Version(
...
36 links = [link.Link]
...
48 class Root(base.APIBase):
I think this is flawed. The top-level root controller should not depend on a class defined in the v1 api.
I think the tests in ironic. tests.api. test_root are fine -- these are ensuring that the RootController exposes the /v1/ API, which is distinct from all the test modules that run against the /v1/ API itself. That being said, I agree that several test modules should be moved from ironic/tests/api/ to ironic/ tests/api/ v1/
I see at least two patches needed to address these issues: .v1.base and ...v1.link out of v1
- one to just move the test classes to a 'v1/' directory
- another to move api.controllers