TypeError: fake_init_exception() with Neutron exceptions in the tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Low
|
Julie Pichon |
Bug Description
When a Neutron Client exception is thrown in the unit tests (usually because a call wasn't mocked properly, see e.g. bug 1284664), the following error is displayed instead of the actual error:
TypeError: fake_init_
Neutron seems to prefer to declare exceptions by overriding the message attribute (and possibly adding additional information later, like a 'reason' for the failure), rather than passing the code + message around as arguments. We should handle this appropriately and display the correct message.
An example of how to reproduce:
1. Open https:/
2. Comment out the api.network key/values from the stub declarations (L56-58), and comment out the network mocks in the test (L72, L75-76)
3. Run the tests
Actual results:
4. Trace shows as TypeError: fake_init_
Expected results:
4. Trace shows the actual error (here something like Connection to Neutron failed: Maximum attempts reached)
Changed in horizon: | |
milestone: | none → juno-1 |
Changed in horizon: | |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | juno-1 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/91586
Review: https:/