summaryrefslogtreecommitdiffstats
path: root/cobbler/item_system.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-08 15:02:06 -0400
committerJim Meyering <jim@meyering.net>2006-05-08 15:02:06 -0400
commitd4f71b4318fedf374844030095c6c8dd544f0e92 (patch)
treedd5bb88c2587a0ab4ea2638374ad4a71bbd868a9 /cobbler/item_system.py
parent038a4383ccb6230f927960a34288c5cf6fbd3455 (diff)
downloadthird_party-cobbler-d4f71b4318fedf374844030095c6c8dd544f0e92.tar.gz
third_party-cobbler-d4f71b4318fedf374844030095c6c8dd544f0e92.tar.xz
third_party-cobbler-d4f71b4318fedf374844030095c6c8dd544f0e92.zip
Interim checkin while straightening out exceptions. The last_error bit reminded me of the
thing I hated most about Microsoft SDK/DDK programming (that being, last_error and inconsistant error handling), so it had to go.
Diffstat (limited to 'cobbler/item_system.py')
-rw-r--r--cobbler/item_system.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index 0819781..fef3743 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -6,6 +6,7 @@ Michael DeHaan <mdehaan@redhat.com>
import utils
import item
+from cobbler_exception import CobblerException
class System(item.Item):
@@ -32,8 +33,7 @@ class System(item.Item):
"""
new_name = utils.find_system_identifier(name)
if not new_name:
- utils.set_error("bad_sys_name")
- return False
+ raise CobblerException("bad_sys_name")
self.name = name # we check it add time, but store the original value.
return True
@@ -52,8 +52,7 @@ class System(item.Item):
A system is valid when it contains a valid name and a profile.
"""
if self.name is None:
- utils.set_error("bad_sys_name")
- return False
+ raise CobblerException("bad_sys_name")
if self.profile is None:
return False
return True