Send "501 Not Implemented" back when method not found
authorRené Nussbaumer <rn@google.com>
Tue, 30 Mar 2010 14:16:04 +0000 (16:16 +0200)
committerRené Nussbaumer <rn@google.com>
Tue, 30 Mar 2010 14:21:49 +0000 (16:21 +0200)
Before this was "400 Bad Request" and thus it didn't reflect
the reality.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

daemons/ganeti-rapi

index a5092e2..255e038 100755 (executable)
@@ -107,8 +107,8 @@ class RemoteApiHttpServer(http.auth.HttpServerRequestAuthentication,
       try:
         ctx.handler_fn = getattr(ctx.handler, method)
       except AttributeError:
-        raise http.HttpBadRequest("Method %s is unsupported for path %s" %
-                                  (method, req.request_path))
+        raise http.HttpNotImplemented("Method %s is unsupported for path %s" %
+                                      (method, req.request_path))
 
       ctx.handler_access = getattr(ctx.handler, "%s_ACCESS" % method, None)