FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-04-2011, 06:02 PM
David Lehman
 
Default Remove obsolete error handling left over from the old storage code.

---
pyanaconda/constants.py | 17 -----
pyanaconda/errors.py | 162 ----------------------------------------------
pyanaconda/exception.py | 2 +-
pyanaconda/yuminstall.py | 1 -
4 files changed, 1 insertions(+), 181 deletions(-)
delete mode 100644 pyanaconda/errors.py

diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index 3197914..ae96636 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -31,21 +31,6 @@ DISPATCH_FORWARD = 1
DISPATCH_DEFAULT = None
DISPATCH_WAITING = 2

-# different types of partition requests
-# REQUEST_PREEXIST is a placeholder for a pre-existing partition on the system
-# REQUEST_NEW is a request for a partition which will be automatically
-# created based on various constraints on size, drive, etc
-# REQUEST_RAID is a request for a raid device
-# REQUEST_PROTECTED is a preexisting partition which can't change
-# (harddrive install, harddrive with the isos on it)
-#
-REQUEST_PREEXIST = 1
-REQUEST_NEW = 2
-REQUEST_RAID = 4
-REQUEST_PROTECTED = 8
-REQUEST_VG = 16 # volume group
-REQUEST_LV = 32 # logical volume
-
# XXX this is made up and used by the size spinner; should just be set with
# a callback
MAX_PART_SIZE = 1024*1024*1024
@@ -64,8 +49,6 @@ productArch = product.productArch
bugzillaUrl = product.bugUrl
isFinal = product.isFinal

-lvmErrorOutput = "/tmp/lvmout"
-
exceptionText = _("An unhandled exception has occurred. This "
"is most likely a bug. Please save a copy of "
"the detailed exception and file a bug report")
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
deleted file mode 100644
index 0bb6237..0000000
--- a/pyanaconda/errors.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# errors.py: exception classes used throughout anaconda
-#
-# Copyright (C) 2002, 2007, 2008 Red Hat, Inc. All rights reserved.
-#
-# 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, see <http://www.gnu.org/licenses/>.
-#
-# Author(s): Peter Jones <pjones@redhat.com>
-# Chris Lumens <clumens@redhat.com>
-# Matt Wilson <msw@redhat.com>
-# Jeremy Katz <katzj@redhat.com>
-# Mike Fulbright <msf@redhat.com>
-#
-
-import string
-import os
-from constants import lvmErrorOutput
-
-# Exceptions for use in lvm operations.
-
-class LvmError(Exception):
- """An error occurred with lvm."""
- def __init__(self, command, name=None):
- self.command = command
- self.name = name
- self.log = self.getLvmOutput()
-
- def getLvmOutput(self):
- if not os.access(lvmErrorOutput, os.R_OK):
- return ""
- f = open(lvmErrorOutput, "r")
- lines = reduce(lambda x,y: x + [string.strip(y),], f.readlines(), [])
- lines = string.join(reduce(lambda x,y: x + [" %s" % (y,)],
- lines, []), "
")
- return lines
-
- def __str__(self):
- s = ""
- if not self.name is None:
- s = " for device %s" % (self.name,)
- return "%s failed%s
Log:
%s" % (self.command, s, self.log)
-
-class LVCreateError(LvmError):
- def __init__(self, vgname, lvname, size):
- self.vgname = vgname
- self.lvname = lvname
- self.size = size
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "lvcreate of %d Megabyte lv "%s" on vg "%s" failed
"
- "Log:
%s" % (
- self.size, self.lvname, self.vgname, self.log)
-
-class LVRemoveError(LvmError):
- def __init__(self, vgname, lvname):
- self.vgname = vgname
- self.lvname = lvname
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "lvremove of lv "%s" from vg "%s" failed
Log:
%s" % (
- self.lvname, self.vgname, self.log)
-
-class LVResizeError(LvmError):
- def __init__(self, vgname, lvname):
- self.vgname = vgname
- self.lvname = lvname
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "lvresize of lv "%s" from vg "%s" failed
Log:
%s" % (
- self.lvname, self.vgname, self.log)
-
-class VGCreateError(LvmError):
- def __init__(self, vgname, PESize, nodes):
- self.vgname = vgname
- self.PESize = PESize
- self.nodes = nodes
- self.log = self.getLvmOutput()
-
- def __str__(self):
- nodes = string.join(self.nodes, ' ')
- return "vgcreate failed creating vg "%s" (PESize=%dkB) on PVs: %s
"
- "Log:
%s" % (
- self.vgname, self.PESize, nodes, self.log)
-
-class VGRemoveError(LvmError):
- def __init__(self, vgname):
- self.vgname = vgname
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "vgremove of vg "%s" failed
Log:
%s" % (
- self.vgname, self.log)
-
-class PVRemoveError(LvmError):
- def __init__(self, pvname):
- self.pvname = pvname
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "pvremove of pv "%s" failed
Log:
%s" % (
- self.pvname, self.log)
-
-class PVCreateError(LvmError):
- def __init__(self, pvname):
- self.pvname = pvname
- self.log = self.getLvmOutput()
-
- def __str__(self):
- return "pvcreate of pv "%s" failed
Log:
%s" % (
- self.pvname, self.log)
-
-# Exceptions for use in partitioning.
-
-class PartitioningError(Exception):
- """A critical error which must be resolved to continue the installation."""
- def __init__(self, message=""):
- self.message = str(message)
-
- def __str__ (self):
- return self.message
-
-class PartitioningWarning(Exception):
- """A warning which may be ignored and still complete the installation."""
- def __init__(self, message=""):
- self.message = str(message)
-
- def __str__ (self):
- return self.message
-
-class LabelError(Exception):
- """The device could not be labeled."""
- def __init__(self, message=""):
- self.message = str(message)
-
- def __str__(self):
- return self.message
-
-# Exceptions for use in package selection.
-
-class NoSuchGroup(Exception):
- def __init__ (self, value):
- self.value = value
-
- def __str__ (self):
- return self.value
-
-class DispatchError(RuntimeError):
- pass
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 016e9f3..ae1afb7 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -98,7 +98,7 @@ class AnacondaExceptionHandler(ExceptionHandler):
os.kill(os.getpid(), signal.SIGKILL)

def initExceptionHandling(anaconda):
- fileList = [ "/tmp/anaconda.log", "/tmp/lvmout", "/tmp/resize.out",
+ fileList = [ "/tmp/anaconda.log",
"/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",
"/tmp/yum.log", anaconda.rootPath + "/root/install.log",
anaconda.rootPath + "/root/upgrade.log", "/proc/cmdline" ]
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index fdf17c6..1be15f4 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -18,7 +18,6 @@
#

from flags import flags
-from errors import *

import ConfigParser
import sys
--
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 05:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org