[ZWeb] Problems with /acl_users

Shane Hathaway shane@digicool.com
Tue, 26 Sep 2000 09:13:22 -0400 (EDT)

On Tue, 26 Sep 2000, Paul Everitt wrote:

> Hmmm, I know Shane was playing around with some ideas, but I'm pretty
> sure he wasn't working on the real Zope.org.  Shane?

Jim and I like to live on the edge sometimes, I guess.

Here's what we did, using a simple Python interpreter.  (Of course this
only works if you're logged in to www.zope.org.)

INSTANCE_HOME=/usr/local/dc/org python

import ZServer, Zope, BTree
app = Zope.app()
newdata = BTree.BTree()
for key, value in app.acl_users.data:
  newdata[key] = value
app.acl_users.data = newdata

The process could be reversed by switching to a PersistentMapping again.

> Martijn Pieters wrote:
> > 
> > I can't list all the usernames in /acl_users anymore:
> > 
> > Error type:  AttributeError
> > Error value: 'BTreeItems' object has no attribute 'sort'

It would be possible to fix this by calling list() on the returned set.

> > 
> > Traceback (innermost last):
> >   (Snipped to relevancy)
> >   File /usr/local/dc/Zope2/lib/python/AccessControl/User.py, line 681, in user_names
> >     (Object: RoleManager)
> >   File /usr/local/dc/Zope2/lib/python/AccessControl/User.py, line 729, in getUserNames
> >     (Object: RoleManager)
> > AttributeError: (see above)
> > 
> > It seems that someone changed the BTree implementation used in the user
> > folders. I tried to change the domains field for a certain user, and
> > because the return action of that method shows you all users, I can't do
> > it through the web.

We thought PersistentMapping and BTree had a similar enough interface.  
Again, this can be fixed, but perhaps we were overconfident because of our
success in "exorcising" the haunted zope.org.  /Members is now a
BasicBTreeFolder, which results in fewer ghosts.

> > If I use the Monitor to do it, and try and commit the changes, Zope hangs.
> > get_transaction().commit() never returns.

We've had the same results and we don't know why that is.  Acting as a ZEO
client, however, we've had much better success.