diff --git a/Makefile.am b/Makefile.am index 900446b2ae3643fc0f6972c4cc6cfeb44c93f989..c6a1d8e00e5e70e7e8bd5ef9e5810e3cc1410757 100644 --- a/Makefile.am +++ b/Makefile.am @@ -93,7 +93,6 @@ hypervisor_PYTHON = \ rapi_PYTHON = \ lib/rapi/__init__.py \ - lib/rapi/httperror.py \ lib/rapi/baserlib.py \ lib/rapi/connector.py \ lib/rapi/rlib1.py \ diff --git a/lib/rapi/httperror.py b/lib/rapi/httperror.py deleted file mode 100644 index cbb8adb9a5454f48fe3bef6cbaae5021a0b19c0d..0000000000000000000000000000000000000000 --- a/lib/rapi/httperror.py +++ /dev/null @@ -1,49 +0,0 @@ -# -# - -# Copyright (C) 2006, 2007, 2008 Google Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - - -"""HTTP errors. - -""" - - -class HTTPException(Exception): - code = None - message = None - - def __init__(self, message=None): - if message is not None: - self.message = message - - -class HTTPBadRequest(HTTPException): - code = 400 - - -class HTTPNotFound(HTTPException): - code = 404 - - -class HTTPInternalError(HTTPException): - code = 500 - - -class HTTPServiceUnavailable(HTTPException): - code = 503 diff --git a/lib/rapi/rlib1.py b/lib/rapi/rlib1.py index 7ca13b28f73a95fe3ad9ee0d7082e9fd5418b426..e73fc47f438ac5cd8412c821e72cf656d4e2edcc 100644 --- a/lib/rapi/rlib1.py +++ b/lib/rapi/rlib1.py @@ -28,9 +28,9 @@ import ganeti.errors import ganeti.opcodes from ganeti import constants +from ganeti import http from ganeti.rapi import baserlib -from ganeti.rapi import httperror I_FIELDS = ["name", "os", "pnode", "snodes", @@ -313,6 +313,6 @@ class R_os(baserlib.R_Generic): diagnose_data = ganeti.cli.SubmitOpCode(op) if not isinstance(diagnose_data, list): - raise httperror.HTTPInternalError(message="Can't get OS list") + raise http.HTTPInternalError(message="Can't get OS list") return [row[0] for row in diagnose_data if row[1]]