|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] Problems starting xend
On 6/14/05, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx> wrote:
> > indeed, just checked out and the reason is pretty simple ;-)
> >
> > - python 2.3 doesnt complain if dircache.listdir() execute on
> > non-existent directory.
> > - python 2.4 spit out an error and stop on the same situation.
> >
> > now the problem is how to fix it. i propose checking for and
> > make necessary directories from Makefile, and that is clean
> > enough. any comment, Ian?
>
> Thanks for investigating.
>
> Having empty directories under /var in an install tar ball doesn't seem
> the right soloution. We could fix it in install.sh, but by far the best
> soloution would be to create the directories from within xend. Let's
> catch the exception from listdir and create the directory.
>
i have another idea on solution to this problem.
the root of problem is XendDB::fetchall(): this method calls
dircache.listdir("dir-name"). python 2.3 has odd behavior: it doesnt
complain if the "dir-name" is non-existent, and still returns an empty
list. meanwhile, python 2.4 (properly) generates an exception and
stops.
it is tempting to make a directory in fetchall() in this case, but i
dont like that solution, because it would slightly change the semantic
of this method. the directory should be created later if needed, when
xend saves data.
in this patch, i adapt the trick from XendDB of -unstable: returns an
empty list in case the directory is non-existent. this is same as the
behaviour of python 2.3 on current code.
note that this problem only occurs with -stable and -testing, and this
patch is against -testing ChangeSet@xxxxxx
Signed-off-by: Nguyen Anh Quynh <aquynh@xxxxxxxxx>
$ diffstat xendmkdir.patch
XendDB.py | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
xendmkdir.patch
Description: Binary data
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|
|
|
|
|