summaryrefslogtreecommitdiffstats
path: root/cobbler/item_distro.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-05-29 18:48:39 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-05-29 18:48:39 -0400
commitf0d5545df35f9974fb8c4ae572cfea831e79a358 (patch)
tree7876991786aac9479faa894c4d0f7dcb2a9cdcea /cobbler/item_distro.py
parent201e727a1fc571f3a56763dc044a58504cc89af6 (diff)
downloadthird_party-cobbler-f0d5545df35f9974fb8c4ae572cfea831e79a358.tar.gz
third_party-cobbler-f0d5545df35f9974fb8c4ae572cfea831e79a358.tar.xz
third_party-cobbler-f0d5545df35f9974fb8c4ae572cfea831e79a358.zip
Begining of i18n of cobbler. Tests pass, works with English. Need to test
translation function and run manual testing to ensure no functional errors in other places (such as import). cobbler_msg (strings file) has been removed.
Diffstat (limited to 'cobbler/item_distro.py')
-rw-r--r--cobbler/item_distro.py31
1 files changed, 12 insertions, 19 deletions
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index 40a8a7e..5051ff7 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -18,19 +18,12 @@ import utils
import item
import weakref
import os
-import cexceptions
+from cexceptions import *
from rhpl.translate import _, N_, textdomain, utf8
class Distro(item.Item):
- #def __init__(self,config):
- # """
- # Constructor. Requires a back reference to the Config management object.
- # """
- # self.config = config
- # self.clear()
-
def clear(self):
"""
Reset this object.
@@ -81,13 +74,13 @@ class Distro(item.Item):
if utils.find_kernel(kernel):
self.kernel = kernel
return True
- raise cexceptions.CobblerException("no_kernel")
+ raise CX(_("kernel not found"))
def set_breed(self, breed):
if breed is not None and breed.lower() in [ "redhat", "suse" ]:
self.breed = breed.lower()
return True
- raise cexceptions.CobblerException("exc_breed")
+ raise CX(_("invalid value for --breed, see manpage"))
def set_initrd(self,initrd):
"""
@@ -97,7 +90,7 @@ class Distro(item.Item):
if utils.find_initrd(initrd):
self.initrd = initrd
return True
- raise cexceptions.CobblerException("no_initrd")
+ raise CX(_("initrd not found"))
def set_source_repos(self, repos):
"""
@@ -127,7 +120,7 @@ class Distro(item.Item):
if arch in [ "standard", "ia64", "x86", "x86_64" ]:
self.arch = arch
return True
- raise cexceptions.CobblerException("exc_pxe_arch")
+ raise CX(_("PXE arch choices include: x86, x86_64, and ia64"))
def is_valid(self):
"""
@@ -168,12 +161,12 @@ class Distro(item.Item):
# istr = "%s (NOT FOUND)" % self.initrd
#elif os.path.isdir(self.initrd):
# istr = "%s (FOUND BY SEARCH)" % istr
- buf = "distro : %s\n" % self.name
- buf = buf + "kernel : %s\n" % kstr
- buf = buf + "initrd : %s\n" % istr
- buf = buf + "kernel options : %s\n" % self.kernel_options
- buf = buf + "architecture : %s\n" % self.arch
- buf = buf + "ks metadata : %s\n" % self.ks_meta
- buf = buf + "breed : %s\n" % self.breed
+ buf = _("distro : %s\n") % self.name
+ buf = buf + _("kernel : %s\n") % kstr
+ buf = buf + _("initrd : %s\n") % istr
+ buf = buf + _("kernel options : %s\n") % self.kernel_options
+ buf = buf + _("architecture : %s\n") % self.arch
+ buf = buf + _("ks metadata : %s\n") % self.ks_meta
+ buf = buf + _("breed : %s\n") % self.breed
return buf