diff options
author | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-02-28 14:58:42 -0500 |
---|---|---|
committer | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-02-28 21:27:49 -0500 |
commit | d6999fbe8c545292a98c4e3d20f3b80e3e66d901 (patch) | |
tree | 6951c7d833380f3cb31d5f1565e5eeed74495b85 /nova/notifications.py | |
parent | b58bd0cd9a6ecb960a7c833d1f4857629ed1ab05 (diff) | |
download | nova-d6999fbe8c545292a98c4e3d20f3b80e3e66d901.tar.gz nova-d6999fbe8c545292a98c4e3d20f3b80e3e66d901.tar.xz nova-d6999fbe8c545292a98c4e3d20f3b80e3e66d901.zip |
don't stack trace if long ints are passed to db
If we pass a integer, which is longer than the id field in the
database, but a valid python integer into any of the REST API
calls SQLalchemy throws a DataError, and the user sees a 500
instead of InstanceNotFound. This can be triggered by using a
id of 9223372036854775808 (for instance).
This issue is seen on postgresql, mysql and sqlite don't hit it.
Instead, catch the DataError exception, and return an InvalidID
exception. If InvalidID is thrown catch that at the API layer
and return the expected not found.
This was caught when reenabling tempest tests for bug #1046870
and is one of serveral patches in nova needed to enable
test_servers_negative.py in tempest.
Change-Id: I6130863a95567eabd3ae05a09e4a9f26bb5f5098
Diffstat (limited to 'nova/notifications.py')
0 files changed, 0 insertions, 0 deletions