Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Fixed evolve3 that used no longer existing zope.app.component API.
Browse files Browse the repository at this point in the history
  • Loading branch information
menesis committed Dec 13, 2010
1 parent 9be79e3 commit d3fa6b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Expand Up @@ -5,7 +5,7 @@ CHANGES
3.5.1 (unreleased)
------------------

- ...
- Fixed evolve3 that used no longer existing API.


3.5.0 (2009-04-05)
Expand Down
4 changes: 1 addition & 3 deletions src/zope/app/zopeappgenerations/evolve2.py
Expand Up @@ -19,9 +19,7 @@

from zope.app.authentication.principalfolder import IInternalPrincipal
from zope.app.component.interfaces import ISite
from zope.app.zopeappgenerations import getRootFolder

from zope.app.generations.utility import findObjectsProviding
from zope.app.generations.utility import findObjectsProviding, getRootFolder


generation = 2
Expand Down
10 changes: 4 additions & 6 deletions src/zope/app/zopeappgenerations/evolve3.py
Expand Up @@ -22,13 +22,10 @@
from zope import component

from zope.app.component.interfaces import ISite
from zope.app.zopeappgenerations import getRootFolder

from zope.app.generations.utility import findObjectsProviding

from zope.app.component import registration
import zope.app.authentication.interfaces
from zope.app.authentication import groupfolder
from zope.app.generations.utility import findObjectsProviding, getRootFolder
from zope.copypastemove.interfaces import IObjectMover

generation = 3
Expand Down Expand Up @@ -60,7 +57,8 @@ def evolve(context):
"each group folder should only be within the "
"Pluggable Authentication utility that uses it")
# we need to remove this registration
regs = registration.Registered(util).registrations()
regs = [r for r in sm.registeredUtilities()
if r.component == util]
if len(regs) != 1:
raise RuntimeError(
"I don't know how to migrate your database: "
Expand All @@ -69,7 +67,7 @@ def evolve(context):
"like it's registered for something additional "
"that I don't expect")
r = regs[0]
r.registry.unregisterUtility(
sm.unregisterUtility(
util,
zope.app.authentication.interfaces.IAuthenticatorPlugin,
nm)
Expand Down

0 comments on commit d3fa6b3

Please sign in to comment.