lp:~jaypipes/glance/bug704854
- Get this branch:
- bzr branch lp:~jaypipes/glance/bug704854
Branch merges
- Jay Pipes (community): Approve
- Devin Carlen (community): Approve
- Rick Harris (community): Approve
- Soren Hansen: Pending requested
-
Diff: 619 lines (+310/-57)14 files modifiedMANIFEST.in (+1/-0)
bin/glance-api (+7/-3)
bin/glance-combined (+7/-3)
bin/glance-control (+8/-0)
bin/glance-manage (+7/-3)
bin/glance-registry (+7/-3)
bin/glance-upload (+5/-3)
glance/client.py (+1/-1)
glance/registry/db/api.py (+30/-0)
glance/registry/db/models.py (+0/-13)
glance/registry/server.py (+14/-4)
glance/server.py (+43/-22)
tests/unit/test_clients.py (+2/-2)
tests/unit/test_misc.py (+178/-0)
Related bugs
Related blueprints
Recent revisions
- 82. By Jay Pipes
-
Add debugging output to assert in test_misc. Trying to debug what Hudson fails on...
- 79. By Jay Pipes
-
I should probably rebase this commit considering all the previous
commits weren't actually addressing the issue. The fact that I
had glance-api and glance-registry installed on my local machine
was causing the test runs to improperly return a passing result.It just so happens that the glance-api and glance-registry that
I had installed to my /usr/local/bin were the very same programs
that were from a previous branch I had locally where I fixed the
root cause of this issue, which was that the sqlalchemy @validates
decorator does NOT fire for *new* objects, only existing ones, which
resulted in image_create() improperly storing NULL data in type, name,
and other non-nullable fields in the database. This then set off
a domino effect which caused the next call from
glance.server. _upload_ and_activate( ) to die a horrible death due to
the @validates decorator then firing on the already-created Image
object. This horrible death was improperly being raised from the
glance.client as a BadRequest instead of exception.Invalid, which
caused the API server to ignore the text in the actual Invalid
exception coming from the registry server.In short, this patch finally fixes the root of the problem by
placing a validate_image() function guard which throws exception.Invalid
for any invalid data coming into the _image_update() method in the db
API. It also adds a bunch of logging statements and ensures that
exceptions throughout the call stack between the API server to the
glance.registry. Client to the Registry server are properly handled and
that the text of those exceptions isn't thrown away willy-nilly. - 73. By Jay Pipes
-
This adds a test case for LP Bug 704854 -- Exception
raised by Registry server gets eaten by API server.The test involves spinning up an API server and a registry
server, firing cURL and glance-upload against the API
server with invalid requests, and verifying that appropriate
exception messages are contained in the response.I cannot reproduce 704854 now. Not sure what changed in
the code that actually fixed this, but the test case verifies
that the behaviour described in the bug does not occur any more.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:~glance-coresec/glance/cactus-trunk