summaryrefslogtreecommitdiffstats
path: root/cobbler/item_distro.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-08 18:34:42 -0400
committerJim Meyering <jim@meyering.net>2006-05-08 18:34:42 -0400
commit804a564ac24ff22cd46583fa98d8140a8b10f476 (patch)
treefadba99af49b4da97be1a5b7ab7af42cb780db39 /cobbler/item_distro.py
parentd4f71b4318fedf374844030095c6c8dd544f0e92 (diff)
downloadthird_party-cobbler-804a564ac24ff22cd46583fa98d8140a8b10f476.tar.gz
third_party-cobbler-804a564ac24ff22cd46583fa98d8140a8b10f476.tar.xz
third_party-cobbler-804a564ac24ff22cd46583fa98d8140a8b10f476.zip
Adding exception handling to remove the problem of propogating error codes all the way up the stack. Still not quite super-consistant, but getting there. Util functions still return true/false since they just ask questions, but API functions will throw errors to ensure they are being dealt with. Main CLI class needs to take advantage of this fact and become simpler. Tests are already modified to detect new exceptions with one exception :)
Diffstat (limited to 'cobbler/item_distro.py')
-rw-r--r--cobbler/item_distro.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index 59250af..e61ea7b 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -10,7 +10,7 @@ import utils
import item
import weakref
import os
-from cobbler_exception import CobblerException
+import cexceptions
class Distro(item.Item):
@@ -51,7 +51,7 @@ class Distro(item.Item):
if utils.find_kernel(kernel):
self.kernel = kernel
return True
- raise CobblerException("no_kernel")
+ raise cexceptions.CobblerException("no_kernel")
def set_initrd(self,initrd):
"""
@@ -61,7 +61,7 @@ class Distro(item.Item):
if utils.find_initrd(initrd):
self.initrd = initrd
return True
- raise CobblerException("no_initrd")
+ raise cexceptions.CobblerException("no_initrd")
def is_valid(self):
"""