From 937e4814cb7fe7f7a07d2362f179da519fce67be Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 14 Oct 2008 08:24:52 +0000 Subject: [PATCH] Get rid of httperror module This was a leftover from the early days of the remote API in Ganeti 1.2. Reviewed-by: ultrotter --- Makefile.am | 1 - lib/rapi/httperror.py | 49 ------------------------------------------- lib/rapi/rlib1.py | 4 ++-- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 lib/rapi/httperror.py diff --git a/Makefile.am b/Makefile.am index 900446b2a..c6a1d8e00 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 cbb8adb9a..000000000 --- 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 7ca13b28f..e73fc47f4 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]] -- GitLab