summaryrefslogtreecommitdiffstats
path: root/cobbler/action_enchant.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/action_enchant.py
parent201e727a1fc571f3a56763dc044a58504cc89af6 (diff)
downloadcobbler-f0d5545df35f9974fb8c4ae572cfea831e79a358.tar.gz
cobbler-f0d5545df35f9974fb8c4ae572cfea831e79a358.tar.xz
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/action_enchant.py')
-rw-r--r--cobbler/action_enchant.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/cobbler/action_enchant.py b/cobbler/action_enchant.py
index 260d1348..7dcc0977 100644
--- a/cobbler/action_enchant.py
+++ b/cobbler/action_enchant.py
@@ -13,7 +13,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
-import cexceptions
+from cexceptions import *
import os
import os.path
import sub_process
@@ -37,13 +37,13 @@ class Enchant:
self.system = system
self.is_virt = is_virt
if address is None:
- raise cexceptions.CobblerException("enchant_failed","no address specified")
+ raise CX(_("enchant failed. no address specified"))
if system is None and profile is None:
- raise cexceptions.CobblerException("enchant_failed","no profile specified")
+ raise CX(_("enchant failed. no profile specified"))
if system is not None and self.config.systems().find(system) is None:
- raise cexceptions.CobblerException("enchant_failed","system name not found")
+ raise CX(_("enchant failed. system not found"))
if profile is not None and self.config.profiles().find(profile) is None:
- raise cexceptions.CobblerException("enchant_failed","profile name not found")
+ raise CX(_("enchant failed. profile name not found"))
def ssh_exec(self,cmd,catch_fail=True):
@@ -56,7 +56,7 @@ class Enchant:
rc = sub_process.call(cmd2,shell=True)
print "returns: %d" % rc
if catch_fail and rc != 0:
- raise cexceptions.CobblerException("enchant_failed","ssh failure")
+ raise CX(_("enchant failed. SSH error."))
def run(self):
"""
@@ -79,7 +79,7 @@ class Enchant:
koan = os.path.basename(self.settings.koan_path)
where_is_koan = os.path.join(self.settings.webdir,os.path.basename(koan))
if not os.path.exists(where_is_koan) or os.path.isdir(where_is_koan):
- raise cexceptions.CobblerException("enchant_failed","koan is missing")
+ raise CX(_("enchant failed. koan_path is not correct in /var/lib/cobbler/settings"))
try:
self.ssh_exec("wget http://%s/cobbler/%s" % (self.settings.server, koan))
@@ -107,6 +107,6 @@ class Enchant:
return True
except:
traceback.print_exc()
- raise cexceptions.CobblerException("enchant_failed","exception")
+ raise CX(_("enchant failed. an exception occurred."))
return False # shouldn't be here