Comment 8 for bug 1653645

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/python-neutronclient (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/29933
Submitter: Denis V. Meltsaykin <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: d43b2ff07971a2c9fd67b75aaa0232b758f42f37
Author: Akihiro Motoki <email address hidden>
Date: Thu Jan 19 09:09:38 2017

Ensure to use exception per status code for all cases

Previously, only when an exception has a content with
{'NeutronError': {'type': xxxx, 'message': xxxx}},
exception per status code is raised from neutronclient library.
There are cases where this kind of message is not contained
in exception messages, for example, some extension is loaded.

Library users expect an exception is raised based on response
status code and it should not depend on an exception message.
This commit applies a fallback logic to map generic per-status
exception to all exception types from the neutron server.

Closes-Bug: #1653645

(cherry-picked from af1a55bfd2e47b0e3cd8349f0a9b1277474fee18)
Change-Id: Ib3d0a8359aed444b12217b3404d40443d61fc2c0