The traits and the inventories wsgi handler inserted the detailed error
message to the webob.exc.HTTPXXX exceptions via the 'explanation' kwarg.
This caused that the generated error messages does not contain the generic
explanation of the HTTP error code just the passed in explanation text.
The rest of the placement API uses first positional arg of the exception
classes to pass in the extra details. Having this inconsistency makes
really hard to print proper error messages from the osc-placement
plugin.
This patch removes the incosistency by changing the code to use the
positional arg.
The change does not affect nova.scheduler.client.report._RE_INV_IN_USE
regex usage as that regex applied via re.search() and this change only
adds a new sentece to the message.
Reviewed: https:/ /review. openstack. org/568567 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=90d2dbedefb cc99a20a6a86888 ef1d316d5d119f
Committed: https:/
Submitter: Zuul
Branch: master
commit 90d2dbedefbcc99 a20a6a86888ef1d 316d5d119f
Author: Balazs Gibizer <email address hidden>
Date: Tue May 15 13:44:59 2018 +0200
placement: Fix HTTP error generation
The traits and the inventories wsgi handler inserted the detailed error
message to the webob.exc.HTTPXXX exceptions via the 'explanation' kwarg.
This caused that the generated error messages does not contain the generic
explanation of the HTTP error code just the passed in explanation text.
The rest of the placement API uses first positional arg of the exception
classes to pass in the extra details. Having this inconsistency makes
really hard to print proper error messages from the osc-placement
plugin.
This patch removes the incosistency by changing the code to use the
positional arg.
The change does not affect nova.scheduler. client. report. _RE_INV_ IN_USE
regex usage as that regex applied via re.search() and this change only
adds a new sentece to the message.
Change-Id: I196c2e3dabcbf0 564c1ca0bd4870d c2df3efc836
Close-Bug: #1771325