From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: xen-devel@lists.xensource.com, ewan@redhat.com
Subject: [PATCH][RESEND] Better error reporting in config file parsing errors
Date: Wed, 25 Oct 2006 10:43:07 -0300 [thread overview]
Message-ID: <20061025134307.GC16944@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 572 bytes --]
Hello,
I lost some time today using xm create, while invoking 'xm create cfg',
because I accidentally had a file called 'cfg' in my current working
directory. As the error dumping refers only to 'cfg', it revealed itself
somehow tricky to figure out.
I'm attaching a patch that informs the complete path of the file being
processing, besides giving a more complete error message that would give
more valuable input to help finding any issues.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
[-- Attachment #2: synerr.patch --]
[-- Type: text/plain, Size: 1123 bytes --]
--- xen-3.0.3-testing-11633/tools/python/xen/xm/opts.py.orig 2006-09-28 18:52:39.000000000 -0400
+++ xen-3.0.3-testing-11633/tools/python/xen/xm/opts.py 2006-10-20 16:59:35.000000000 -0400
@@ -483,11 +483,8 @@ class Opts:
'path' search path
'defconfig' script name
"""
- for x in [ '' ] + self.vals.path.split(':'):
- if x:
- p = os.path.join(x, self.vals.defconfig)
- else:
- p = self.vals.defconfig
+ for x in [ os.path.curdir ] + self.vals.path.split(':'):
+ p = os.path.join(x, self.vals.defconfig)
if os.path.exists(p):
self.info('Using config file "%s".' % p)
self.load(p, help)
@@ -518,6 +515,10 @@ class Opts:
exec cmd in globs, locs
try:
execfile(defconfig, globs, locs)
+ except SyntaxError,e:
+ raise SyntaxError, \
+ "Errors were found at line %d while processing %s:\n\t%s"\
+ %(e.lineno,defconfig,e.text)
except:
if not help: raise
if help:
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-10-25 13:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-25 13:43 Glauber de Oliveira Costa [this message]
2006-10-25 14:03 ` [PATCH][RESEND] Better error reporting in config file parsing errors Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2006-10-23 19:35 Glauber de Oliveira Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061025134307.GC16944@redhat.com \
--to=gcosta@redhat.com \
--cc=ewan@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.