yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #58060
[Bug 1520159] Fix merged to glance (master)
Reviewed: https://review.openstack.org/273196
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=8a636223487d2f8b9639e84799334bc29706875f
Submitter: Jenkins
Branch: master
commit 8a636223487d2f8b9639e84799334bc29706875f
Author: Gábor Antal <antal@xxxxxxxxxxxxxxx>
Date: Wed Jan 27 19:48:57 2016 +0100
Extracted HTTP response codes to constants
There are several places in the source code where
HTTP response codes are used as numeric values.
These values are used from six.moves and the
numeric values are replaced by constants.
All of the used status codes were replaced with symbolic constants
from six.moves.http_client. More about six.moves.http_client can be
found at [2], under the table "Supported renames:".
Also, this change improves code readibility.
This patchset does not extract numeric values
from the tests, but it can be found at [1].
[1]: Idfc7b043552f428f01ac3e47b270ee0639a8f5bc
[2]: https://pythonhosted.org/six/#module-six.moves
Change-Id: Ib9e26dcea927e96e65c626c18421621d3a29a64d
Partial-Bug: #1520159
** Changed in: glance
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1520159
Title:
HTTP response codes should be extracted to constants
Status in Glance:
Fix Released
Bug description:
There are several places in the source code where HTTP response codes
are used as numeric values. These values should be extracted to a
common file and the numeric values should be replaced by constants.
For example:
common/auth.py:186
elif resp.status == 404: --> elif resp.status == HTTP_NOT_FOUND;
api/middleware/cache.py:261
if method == 'GET' and status_code == 204: --> if method == 'GET' and status_code == HTTP_NO_CONTENT:
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1520159/+subscriptions
References