From 88969ae0db99b69a9601a77fe44a3451bd0d960c Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Wed, 24 Feb 2010 09:19:53 +0100 Subject: [PATCH] Don't print the template filename and line number in error messages. The template filename and line number do not correspond to the filename and line number of the actual template files, because they are representing the dynamically rendered template, not the text files on the disk, so printing it out, when an error occurs, may be misleading. --- src/pylorax/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pylorax/base.py b/src/pylorax/base.py index b930843b..54f472f6 100644 --- a/src/pylorax/base.py +++ b/src/pylorax/base.py @@ -79,8 +79,8 @@ class BaseImageClass(BaseLoraxClass): func = getattr(self, func, None) if not func: - err = "{0}:{1}: invalid command: {2}" - err = err.format(template_file, lineno, line) + err = "invalid command: {0}" + err = err.format(line) self.perror(err) else: try: @@ -88,8 +88,8 @@ class BaseImageClass(BaseLoraxClass): self.pdebug(msg) func(*args) except TypeError: - err = "{0}:{1}: invalid command syntax: {2}" - err = err.format(template_file, lineno, line) + err = "invalid command syntax: {0}" + err = err.format(line) self.perror(err) def makedirs(self, *dirs):