diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-05-29 18:48:39 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-05-29 18:48:39 -0400 |
commit | f0d5545df35f9974fb8c4ae572cfea831e79a358 (patch) | |
tree | 7876991786aac9479faa894c4d0f7dcb2a9cdcea /cobbler/item_system.py | |
parent | 201e727a1fc571f3a56763dc044a58504cc89af6 (diff) | |
download | third_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_system.py')
-rw-r--r-- | cobbler/item_system.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/cobbler/item_system.py b/cobbler/item_system.py index 10a9593..cb6b5c8 100644 --- a/cobbler/item_system.py +++ b/cobbler/item_system.py @@ -14,16 +14,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import utils import item -import cexceptions +from cexceptions import * from rhpl.translate import _, N_, textdomain, utf8 class System(item.Item): - #def __init__(self,config): - # self.config = config - # self.clear() - def make_clone(self): ds = self.to_datastruct() cloned = System(self.config) @@ -67,7 +63,7 @@ class System(item.Item): return True new_name = utils.find_system_identifier(name) if not new_name: - raise cexceptions.CobblerException("bad_sys_name") + raise CX(_("system name must be an MAC address, IP, or resolvable host")) self.name = name # we check it add time, but store the original value. return True @@ -100,7 +96,7 @@ class System(item.Item): if self.config.profiles().find(profile_name): self.profile = profile_name return True - raise cexceptions.CobblerException("exc_profile") + raise CX(_("invalid profile name")) def set_netboot_enabled(self,netboot_enabled): """ @@ -145,11 +141,11 @@ class System(item.Item): } def printable(self): - buf = "system : %s\n" % self.name - buf = buf + "profile : %s\n" % self.profile - buf = buf + "kernel options : %s\n" % self.kernel_options - buf = buf + "ks metadata : %s\n" % self.ks_meta - buf = buf + "ip address : %s\n" % self.pxe_address - buf = buf + "hostname : %s\n" % self.hostname + buf = _("system : %s\n") % self.name + buf = buf + _("profile : %s\n") % self.profile + buf = buf + _("kernel options : %s\n") % self.kernel_options + buf = buf + _("ks metadata : %s\n") % self.ks_meta + buf = buf + _("ip address : %s\n") % self.pxe_address + buf = buf + _("hostname : %s\n") % self.hostname return buf |