You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2017/02/08 04:01:14 UTC

qpid-dispatch git commit: NO-JIRA - Removed dependency from old hashlib

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 9422a77d5 -> 89284d94a


NO-JIRA - Removed dependency from old hashlib

(cherry picked from commit 384ac829a0e17b550c49d5bb7c9a0086ef74772d)
(cherry picked from commit 8dfe219b24549002b74ce527cde09f069a1bfb76)


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/89284d94
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/89284d94
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/89284d94

Branch: refs/heads/master
Commit: 89284d94aaed67c46e54cb6480f9d577d2040715
Parents: 9422a77
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Mon Jan 30 13:40:35 2017 -0500
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Tue Feb 7 22:54:38 2017 -0500

----------------------------------------------------------------------
 python/qpid_dispatch/management/error.py | 66 +++++++++++++++++++++++++--
 1 file changed, 63 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/89284d94/python/qpid_dispatch/management/error.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/error.py b/python/qpid_dispatch/management/error.py
index b700693..0d73e92 100644
--- a/python/qpid_dispatch/management/error.py
+++ b/python/qpid_dispatch/management/error.py
@@ -21,9 +21,69 @@
 ManagementError exception class and subclasses, with status codes used by AMQP.
 """
 
-from httplib import responses as STATUS_TEXT
-from httplib import OK, NO_CONTENT, CREATED, \
-    BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, INTERNAL_SERVER_ERROR, NOT_IMPLEMENTED
+#from httplib import responses as STATUS_TEXT
+#from httplib import OK, NO_CONTENT, CREATED, \
+#    BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, INTERNAL_SERVER_ERROR, NOT_IMPLEMENTED
+
+OK = 200
+NO_CONTENT = 204
+CREATED = 201
+BAD_REQUEST = 400
+UNAUTHORIZED = 401
+FORBIDDEN = 403
+NOT_FOUND = 404
+INTERNAL_SERVER_ERROR = 500
+NOT_IMPLEMENTED = 501
+
+# Mapping status codes to official W3C names
+STATUS_TEXT = {
+    100: 'Continue',
+    101: 'Switching Protocols',
+
+    200: 'OK',
+    201: 'Created',
+    202: 'Accepted',
+    203: 'Non-Authoritative Information',
+    204: 'No Content',
+    205: 'Reset Content',
+    206: 'Partial Content',
+
+    300: 'Multiple Choices',
+    301: 'Moved Permanently',
+    302: 'Found',
+    303: 'See Other',
+    304: 'Not Modified',
+    305: 'Use Proxy',
+    306: '(Unused)',
+    307: 'Temporary Redirect',
+
+    400: 'Bad Request',
+    401: 'Unauthorized',
+    402: 'Payment Required',
+    403: 'Forbidden',
+    404: 'Not Found',
+    405: 'Method Not Allowed',
+    406: 'Not Acceptable',
+    407: 'Proxy Authentication Required',
+    408: 'Request Timeout',
+    409: 'Conflict',
+    410: 'Gone',
+    411: 'Length Required',
+    412: 'Precondition Failed',
+    413: 'Request Entity Too Large',
+    414: 'Request-URI Too Long',
+    415: 'Unsupported Media Type',
+    416: 'Requested Range Not Satisfiable',
+    417: 'Expectation Failed',
+
+    500: 'Internal Server Error',
+    501: 'Not Implemented',
+    502: 'Bad Gateway',
+    503: 'Service Unavailable',
+    504: 'Gateway Timeout',
+    505: 'HTTP Version Not Supported',
+}
+
 
 class ManagementError(Exception):
     """


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org