[Lorax] Don't print the template filename and line number in error messages.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/pylorax/base.py b/src/pylorax/base.py
index b930843..54f472f 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):
-- 
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux