diff options
| author | Dan Prince <dprince@redhat.com> | 2012-08-15 13:07:19 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-08-15 17:11:42 -0400 |
| commit | 00f0b170ec15299b20c345fa1f66f21185c2dc79 (patch) | |
| tree | 4804d141f4bea7c8eaf0642ca87a4b156d0895da /nova/openstack | |
| parent | 40a34547198b8eb32e4afbcf57b5d8f9207b35f3 (diff) | |
| download | nova-00f0b170ec15299b20c345fa1f66f21185c2dc79.tar.gz nova-00f0b170ec15299b20c345fa1f66f21185c2dc79.tar.xz nova-00f0b170ec15299b20c345fa1f66f21185c2dc79.zip | |
Update disk config to check for 'server' in req.
Updates the disk config extension to check for 'server' in the
request body before trying to use it. This avoids a potential
KeyError exception. Given that we already validate the 'server'
dict in servers.py and raise a proper exception there this seems
reasonable to me... no reason to duplicate all of the validation
logic.
The reason this change was able to make it into Nova to begin
with is that the Extensions loader orders things differently
depending on the OS/python version being used. I tested this
by running SchedulerHintsTestCase.test_create_missing_server
on both Fedora 16 (passes) and Fedora 17 (fails). The problem
only manifests itself when the disk config extension gets called
before the scheduler_hints extension. To fix this issue
I've updated the scheduler_hints extensions in this patchset
to simply pass when 'server' isn't defined which like above seems
reasonable because we already validate this in servers.py.
As part of this fix I'm also moving test_create_missing_server out
of the Scheduler Hints tests and into a new ServersAllExtensionsTestCase
class in test_servers.py which explicitly tests for things with *all*
extensions enabled. As part of the move I also updated the test to
look for HTTP 422 Unprocessable Entity which is what we throw when
'server' doesn't exist in a POST to servers (the correct exception).
Fixes LP Bug #1037201.
Change-Id: I912fc1234b2e7a76ecc54140f4a31c2e32fdfa98
Diffstat (limited to 'nova/openstack')
0 files changed, 0 insertions, 0 deletions
