diff options
author | root <root@drwily.rdu.redhat.com> | 2007-09-04 16:59:09 -0400 |
---|---|---|
committer | root <root@drwily.rdu.redhat.com> | 2007-09-04 16:59:09 -0400 |
commit | 2501f06915d373edba243e6c4433cdf0ec344ee8 (patch) | |
tree | 3070b80319605d7ef48fdc3eb93c6ad188e8a3c3 | |
parent | 983bfff46c01178371b4374f62b8588d7ff094ce (diff) | |
download | third_party-cobbler-2501f06915d373edba243e6c4433cdf0ec344ee8.tar.gz third_party-cobbler-2501f06915d373edba243e6c4433cdf0ec344ee8.tar.xz third_party-cobbler-2501f06915d373edba243e6c4433cdf0ec344ee8.zip |
Add some extra debug output to point users at the problem when there is a syntax
error in a template we are feeding to Cheetah.
-rw-r--r-- | cobbler/action_sync.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 3eee849..0fd0ea4 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -353,7 +353,7 @@ class BootSync: except: traceback.print_exc() # leave this in, for now... msg = "err_kickstart2" - raise CX(_("Error copying kickstart file %(src)s to %(dest)s") % { "src" : kickstart_path, "dest" : dest }) + raise CX(_("Error while rendering kickstart file %(src)s to %(dest)s") % { "src" : kickstart_path, "dest" : dest }) def generate_kickstart_signal(self, profile, system=None): """ @@ -547,7 +547,12 @@ class BootSync: # now do full templating scan, where we will also templatify the snippet insertions t = Template(source=data, searchList=[metadata]) - data_out = str(t) + try: + data_out = str(t) + except: + print _("There appears to be an formatting error in the template file.") + print _("For completeness, the traceback from Cheetah has been included below.") + raise # now apply some magic post-filtering that is used by cobbler import and some # other places, but doesn't use Cheetah. Forcing folks to double escape |