summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-11-19 15:57:36 -0500
committerMichael DeHaan <mdehaan@redhat.com>2007-11-19 15:57:36 -0500
commit5883ca6b1b8fe371f98db68ac71982affed8b974 (patch)
tree12e97d4c3154b09cf51a9f76470c2bd2f519b1a6 /cobbler
parente99613c5cccda15759d152d9481eb4b77a6e78ce (diff)
downloadthird_party-cobbler-5883ca6b1b8fe371f98db68ac71982affed8b974.tar.gz
third_party-cobbler-5883ca6b1b8fe371f98db68ac71982affed8b974.tar.xz
third_party-cobbler-5883ca6b1b8fe371f98db68ac71982affed8b974.zip
Make repo code raise exceptions that explain what about the objects is not valid.
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/item_repo.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index 0c486b0..06d855f 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -118,9 +118,9 @@ class Repo(item.Item):
A repo is valid if it has a name and a mirror URL
"""
if self.name is None:
- return False
+ raise CX(_("name is required"))
if self.mirror is None:
- return False
+ raise CX(_("mirror is required"))
if self.mirror.startswith("rhn://"):
# reposync creates directories based on the channel name so this
# prevents a lot of ugly special case handling if we make the