Creating servers with metadata fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
justinsb |
Bug Description
Dan Prince reported this in bug 724143, but this is a separate issue. When metadata is specified, inserting into the database fails. This is because the dictionaries for InstanceMetadata aren't mapped into the database model automatically, and apparently the unit tests didn't hit this.
Dan wrote:
I also tried to create a server with metadata:
cs.create_
When trying with metadata I get a totally different exception:
(nova.api.
(nova.api.
(nova.api.
(nova.api.
(nova.api.
Related branches
- Rick Harris (community): Approve
- Devin Carlen (community): Approve
-
Diff: 18 lines (+9/-0)1 file modifiednova/db/sqlalchemy/api.py (+9/-0)
Changed in nova: | |
assignee: | nobody → justinsb (justin-fathomdb) |
status: | New → In Progress |
Changed in nova: | |
importance: | Undecided → Medium |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → 2011.2 |
status: | Fix Committed → Fix Released |
For anyone curious as to how this snuck through, when I tested it I created the DB model objects in the API layer. I did manual functional testing at that stage. I also created unit tests. However, as part of the review process, it was pointed out that I shouldn't be touching DB objects in the API layer, and so I changed them to simple dictionaries. The tests still passed, but apparently they didn't actually write to the DB, because when this was tried 'for real' it failed, because SQLAlchemy had trouble mapping nested object types (I believe).
In this patch, I've got real testing using the OpenStack API, writing to the DB. It's got a long list of dependencies sadly...