]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix InvalidContentType can't be raised because of error in constructor
authorTatyana Leontovich <tleontov@yahoo-inc.com>
Thu, 24 Jan 2013 15:33:57 +0000 (17:33 +0200)
committerTatyana Leontovich <tleontov@yahoo-inc.com>
Fri, 25 Jan 2013 14:24:55 +0000 (16:24 +0200)
commitcb7dae08aee84d49537477d25a5798f515ff2321
tree9e47e6e08377de53e471d89f421676bec991d69d
parentbf3a9d79a1c3c27331fbc0c80aa2cf09b3712ece
Fix InvalidContentType can't be raised because of error in constructor

InvalidContentType exception class is defined two times:
in quantum.openstack.common.exception and quantum.common.exceptions
with two different signatures.
A lot of code like wsgi.Serializer.serialize() imports one of them but
attempts to use it with the signature of another one, which ends with
TypeError exception.

This change fixes the bug by removing the second definition of
InvalidContentType class and leaving only one which works correctly
with all code. Also adds unit tests for exceptions to prevent this and similar bugs.

Change-Id: I5d932d75ad184a0a6c6419190f2940bd47b7504e
Fixes: bug #1104090
quantum/common/exceptions.py
quantum/tests/unit/test_wsgi.py