[Zope-CMF] RE: ZEO-strangeness.

Tom Bech tom.bech@adcore.no
Tue, 24 Jul 2001 16:28:49 +0200


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C1144C.F44CD2F0
Content-Type: text/plain

> 
> Erik Enge wrote:
> > 
> > Data.fs contains a CMF-site.  On http://localhost everything is
> > working as one would expect, but on http://server stuff in the
> > portal_skins Filesystem Directory Views are "gone".  We know they're
> > there (since we can access them over http://localhost).  Urk?
> 
> I'm wondering if the CMF has been tested on a ZEO setup like this.
> 
> Do each of the clients have copies of the skins folders?
> 
> They probably need to, but this feels semantically odd :-S
> 
> I wonder what the DC'ers think...
> 
> Chris
>

Hi!

I believe I've found the problem:

In CMFCore/DirectoryView.py, in the __of__ method in the DiretoryView
class, the call to _dirreg.getDirectory() fails, so the content of the view
is never delivered and results in an "empty" skins folder. The reason
is that on win32 the path to the skins is on the \CMFDefault\skins\blah
variant while on unix it is /CMFDefault/skins/blah. So, depending on which
of the clients imported CMF first, it ends up as one or the other in
the database. Now, DirectoryView tries to do the right thing via os.path
stuff, but it uses the stored path-name directly as a lookup into the
_directories
dictionary in the DirectoryRegistry class (in getDirectoryInfo()),
which then will miss on one of the two clients. Doing a path.normpath() on
the
input path fixes the problem (or at least the symptoms :)

Patch (against CMF1.1) attached.

Tom

  


------_=_NextPart_000_01C1144C.F44CD2F0
Content-Type: application/octet-stream;
	name="DirectoryView.py.diff"
Content-Disposition: attachment;
	filename="DirectoryView.py.diff"

--- DirectoryView.py.old	Tue Jul 24 14:21:00 2001
+++ DirectoryView.py	Tue Jul 24 14:13:13 2001
@@ -292,7 +292,7 @@
 
     def getDirectoryInfo(self, filepath):
         # Can return None.
-        return self._directories.get(filepath, None)
+        return self._directories.get(path.normpath(filepath), None)
 
     def listDirectories(self):
         dirs = self._directories.keys()

------_=_NextPart_000_01C1144C.F44CD2F0--