Product install regression?

21 messages Options Options
Embed this Post
Permalink
1 2
Alexander Limi

Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
I'm using a buildout instance of the current 3.0 branch of ploneout.

When I try to install a super simple product (generated by ArchGenXML), I  
get the following:

2007-12-04 21:35:45 ERROR Zope.SiteErrorLog  
http://localhost:8080/testsite/portal_quickinstaller/installProducts
Traceback (innermost last):
   Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 364, in  
installProduct
    - __traceback_info__: ('MyProduct',)
   Module Products.ExternalMethod.ExternalMethod, line 231, in __call__
    - __traceback_info__: ((<PloneSite at /testsite>,), {'reinstall':  
False}, (False,))
   Module  
/Users/limi/Projects/Plone/ux/products/MyProduct/Extensions/Install.py,  
line 140, in install
   Module Products.GenericSetup.tool, line 218, in setImportContext
   Module Products.GenericSetup.tool, line 225, in setBaselineContext
   Module Products.GenericSetup.tool, line 230, in applyContextById
   Module Products.GenericSetup.tool, line 910, in _getImportContext
KeyError: 'Unknown context '

I have tried both AGX 1.6 and 2.0 to generate the product. It used to  
work. :)

What's interesting is that this product works on an existing instance of  
Plone 3.0.2 hosted on a different server. So it's either a) a regression,  
b) my instance is screwed up.

I assume buildout should be pretty good at insulating me from bad  
python/egg conflicts, so hopefully it shouldn't be my instance (but it's  
hard to know for sure, of course). I have tried with a clean ploneout  
build too. Same problem.

Any ideas? I'm happy to poke around with a debugger if someone can guide  
me through it. I will be back online sometime around 19:00 CET today  
(10:00 PST).

--
Alexander Limi · http://limi.net


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Alexander Limi · http://limi.net

Alexander Limi

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Tue, 04 Dec 2007 22:17:45 -0800, Alexander Limi  
<limi@...> wrote:

>    Module Products.GenericSetup.tool, line 910, in _getImportContext
> KeyError: 'Unknown context '

The only post I found with partial match was a recent discussion from  
Wichert on the CMF list:
http://www.gossamer-threads.com/lists/zope/cmf/211385

No idea if it's related at all. The error message output matches, at least.

--
Alexander Limi · http://limi.net


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Alexander Limi · http://limi.net

Alec Mitchell

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Looks similar to the test error in CMFPlone 3.0 branch and trunk that
cropped up somewhere around November 23.  Take a look in the
nightlies.

Alec

On Dec 4, 2007 10:20 PM, Alexander Limi <limi@...> wrote:

> On Tue, 04 Dec 2007 22:17:45 -0800, Alexander Limi
> <limi@...> wrote:
>
> >    Module Products.GenericSetup.tool, line 910, in _getImportContext
> > KeyError: 'Unknown context '
>
> The only post I found with partial match was a recent discussion from
> Wichert on the CMF list:
> http://www.gossamer-threads.com/lists/zope/cmf/211385
>
> No idea if it's related at all. The error message output matches, at least.
>
>
> --
> Alexander Limi · http://limi.net
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Plone-developers mailing list
> Plone-developers@...
> https://lists.sourceforge.net/lists/listinfo/plone-developers
>

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Wichert Akkerman

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Alexander Limi
Previously Alexander Limi wrote:

> I'm using a buildout instance of the current 3.0 branch of ploneout.
>
> When I try to install a super simple product (generated by ArchGenXML), I  
> get the following:
>
> 2007-12-04 21:35:45 ERROR Zope.SiteErrorLog  
> http://localhost:8080/testsite/portal_quickinstaller/installProducts
> Traceback (innermost last):
>    Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 364, in  
> installProduct
>     - __traceback_info__: ('MyProduct',)
>    Module Products.ExternalMethod.ExternalMethod, line 231, in __call__
>     - __traceback_info__: ((<PloneSite at /testsite>,), {'reinstall':  
> False}, (False,))
>    Module  
> /Users/limi/Projects/Plone/ux/products/MyProduct/Extensions/Install.py,  
> line 140, in install
>    Module Products.GenericSetup.tool, line 218, in setImportContext
>    Module Products.GenericSetup.tool, line 225, in setBaselineContext
>    Module Products.GenericSetup.tool, line 230, in applyContextById
>    Module Products.GenericSetup.tool, line 910, in _getImportContext
> KeyError: 'Unknown context '
>
> I have tried both AGX 1.6 and 2.0 to generate the product. It used to  
> work. :)
>
> What's interesting is that this product works on an existing instance of  
> Plone 3.0.2 hosted on a different server. So it's either a) a regression,  
> b) my instance is screwed up.

Or c) what used to result in a silent but nasty problem now results in a
proper exception. And looking at that error message you are indeed
trying to set the context to "", which is obviously invalid.

Wichert.

--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 10:36 AM, Wichert Akkerman wrote:

> Previously Alexander Limi wrote:
>> What's interesting is that this product works on an existing  
>> instance of
>> Plone 3.0.2 hosted on a different server. So it's either a) a  
>> regression,
>> b) my instance is screwed up.
>
> Or c) what used to result in a silent but nasty problem now results  
> in a
> proper exception. And looking at that error message you are indeed
> trying to set the context to "", which is obviously invalid.
while i agree that passing '' as the context is nasty, this used to re-
apply the current state (or maybe the latest snapshot?), which did  
help when populating a test layer with some content (to avoid creating  
that content for every single test).  for example the linkintegrity  
test layer contains the following code:

         # apply plone profile to register local utilities etc
         setup_tool = portal.portal_setup
         setup_tool.setImportContext('')     # pass empty id to re-
apply current state (snapshot)
         setup_tool.runAllImportSteps()

without it some registrations are missing making the tests fail, which  
is also the case now that the call to `setImportContext` produces an  
exception... :)  so my question is, what is the best practice here to  
still be able to use a layer?  or do i need to drop the layer again  
and move things back to `afterSetup`, effectively making the tests run  
twice as slow?

cheers,


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Wichert Akkerman

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Previously Andreas Zeidler wrote:

> On Dec 5, 2007, at 10:36 AM, Wichert Akkerman wrote:
> >Previously Alexander Limi wrote:
> >>What's interesting is that this product works on an existing  
> >>instance of
> >>Plone 3.0.2 hosted on a different server. So it's either a) a  
> >>regression,
> >>b) my instance is screwed up.
> >
> >Or c) what used to result in a silent but nasty problem now results  
> >in a
> >proper exception. And looking at that error message you are indeed
> >trying to set the context to "", which is obviously invalid.
>
> while i agree that passing '' as the context is nasty, this used to re-
> apply the current state (or maybe the latest snapshot?), which did  
> help when populating a test layer with some content (to avoid creating  
> that content for every single test).  for example the linkintegrity  
> test layer contains the following code:
>
>         # apply plone profile to register local utilities etc
>         setup_tool = portal.portal_setup
>         setup_tool.setImportContext('')     # pass empty id to re-
> apply current state (snapshot)
>         setup_tool.runAllImportSteps()

That killed the base profile in all versions of Plone 3. It has never
been a valid thing to do. I'm not sure what 're-apply the current state'
would even do. and I feel I know GS reasonably well by now :)

> without it some registrations are missing making the tests fail, which  
> is also the case now that the call to `setImportContext` produces an  
> exception... :)  so my question is, what is the best practice here to  
> still be able to use a layer?  or do i need to drop the layer again  
> and move things back to `afterSetup`, effectively making the tests run  
> twice as slow?

I don't know what your exact needs are. If you want to make sure your
steps are registered you can use applyContext(context_id). If you want
to import steps from a profile you use runAllImportStepsFromProfile.

Wichert.


--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 12:17 PM, Wichert Akkerman wrote:
> Previously Andreas Zeidler wrote:
>>        # apply plone profile to register local utilities etc
>>        setup_tool = portal.portal_setup
>>        setup_tool.setImportContext('')     # pass empty id to re-
>> apply current state (snapshot)
>>        setup_tool.runAllImportSteps()
>
> That killed the base profile in all versions of Plone 3. It has never
> been a valid thing to do.

yes, it sure looked nasty, but i ran into that code when looking into  
ways of moving the creation of sample content onto the layer, and it  
worked... :)

> I'm not sure what 're-apply the current state'
> would even do. and I feel I know GS reasonably well by now :)

well, this is why i'm asking you, isn't it? :)  anyway, it did the  
trick — without it stuff from the portal was missing at that stage,  
i.e. utilities etc.

> I don't know what your exact needs are.

i'd like to create some sample content to test linkintegrity with, and  
i don't want to put that into `afterSetUp`, since this would repeat it  
for every single test making things much slower.  a quick look at http://dev.plone.org/plone/browser/plone.app.linkintegrity/tags/1.0.2/plone/app/linkintegrity/tests/layer.py 
  should give you the basic idea.

i thought that was one of the original motivations for using layers,  
but maybe i got that wrong.  i completely agree that needing this hack  
to make it work is indeed nasty, and i'd also like to do this in a  
saner way, but how?  what's the best practice of using a layer to  
create sample content for your tests?

> If you want to make sure your
> steps are registered you can use applyContext(context_id). If you want
> to import steps from a profile you use runAllImportStepsFromProfile.

neither seems to do the same — i've spent the last 1.5 hours trying  
various things like that, but no luck. :)


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Raphael Ritz

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Andreas Zeidler wrote:

[..]

>
> neither seems to do the same — i've spent the last 1.5 hours trying
> various things like that, but no luck. :)
>

keep us updated on any progress or feedback you get on this.
I for sure would be interested in an answer to this as well.

Raphael


>
> andi
>
> --
> zeidler it consulting - http://zitc.de/ - info@...
> friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
> pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
> plone 3.0.3 released! -- http://plone.org/products/plone
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Plone-developers mailing list
> Plone-developers@...
> https://lists.sourceforge.net/lists/listinfo/plone-developers


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 1:11 PM, Raphael Ritz wrote:
>> neither seems to do the same — i've spent the last 1.5 hours trying
>> various things like that, but no luck. :)
>
> keep us updated on any progress or feedback you get on this.
> I for sure would be interested in an answer to this as well.

so it turns out the test failures i was getting weren't due to the now  
unsupported hack to re-apply the current profile, but due to alec's  
changes in r18239.  in fact, the test layer works nicely without the  
hack, and consequently it's gone now (see r18303).

however, with CMFPlone newer than r18238 linkintegrity tests still  
fail, but i kinda feel it's not really my responsibility to fix that,  
is it? :)

cheers,


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 2:16 PM, Andreas Zeidler wrote:
> however, with CMFPlone newer than r18238 linkintegrity tests still  
> fail, but i kinda feel it's not really my responsibility to fix  
> that, is it? :)

ah well, fixed in r18304 :)

> cheers,
>
>
> andi


ps: i guess since the linkintegrity package is part of plone now it's  
okay to import from it, right?

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Wichert Akkerman

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Andreas Zeidler wrote:

> On Dec 5, 2007, at 2:16 PM, Andreas Zeidler wrote:
>> however, with CMFPlone newer than r18238 linkintegrity tests still
>> fail, but i kinda feel it's not really my responsibility to fix that,
>> is it? :)
>
> ah well, fixed in r18304 :)
>
>> cheers,
>>
>>
>> andi
>
>
> ps: i guess since the linkintegrity package is part of plone now it's
> okay to import from it, right?

For plone.app that is fine. For Plone 4 you'll have to add a dependency on
Products.CMFPlone if you do that.

Wichert.

--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 2:45 PM, Wichert Akkerman wrote:
> Andreas Zeidler wrote:
>> ps: i guess since the linkintegrity package is part of plone now  
>> it's okay to import from it, right?
>
> For plone.app that is fine. For Plone 4 you'll have to add a  
> dependency on Products.CMFPlone if you do that.

it's already in the `install_requires` of `Products.CMFPlone`, but do  
you think we should start adding minimal versions there?


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Wichert Akkerman

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Previously Andreas Zeidler wrote:

> On Dec 5, 2007, at 2:45 PM, Wichert Akkerman wrote:
> >Andreas Zeidler wrote:
> >>ps: i guess since the linkintegrity package is part of plone now  
> >>it's okay to import from it, right?
> >
> >For plone.app that is fine. For Plone 4 you'll have to add a  
> >dependency on Products.CMFPlone if you do that.
>
> it's already in the `install_requires` of `Products.CMFPlone`, but do  
> you think we should start adding minimal versions there?

Yes. No exact pinning, but minimum versions if they are indeed required
should be there.

Wichert.


--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 3:10 PM, Wichert Akkerman wrote:
> Yes. No exact pinning, but minimum versions if they are indeed  
> required
> should be there.

+1 and fixed in r18306.


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Alexander Limi

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Wichert Akkerman
On Wed, 05 Dec 2007 01:36:26 -0800, Wichert Akkerman  
<wichert@...> wrote:

> Or c) what used to result in a silent but nasty problem now results in a
> proper exception. And looking at that error message you are indeed
> trying to set the context to "", which is obviously invalid.

As an end-user, this is a regression from earlier 3.0.x versions, and at  
least needs a recommended way to fix it. It's not obvious what to do at  
this point.

Can it be fixed in AGX, or is the error elsewhere? Even if it can be fixed  
in AGX, it's a bit scary that products that were working earlier stop  
working in a minor release, no matter how "correct" it is.

--
Alexander Limi · http://limi.net


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Alexander Limi · http://limi.net

Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
On Dec 5, 2007, at 6:07 PM, Alexander Limi wrote:
> As an end-user, this is a regression from earlier 3.0.x versions,  
> and at
> least needs a recommended way to fix it. It's not obvious what to do  
> at
> this point.

the following patch fixes the problem in alex' case:

---------- snip ----------
diff -rU5 Downloads/ConceptCards/Extensions/Install.py products/
ConceptCards/Extensions/Install.py
--- Downloads/ConceptCards/Extensions/Install.py 2007-11-20  
23:13:59.000000000 +0100
+++ products/ConceptCards/Extensions/Install.py 2007-12-05  
21:04:50.000000000 +0100
@@ -132,14 +132,11 @@
          else:
              print >>out,'no output'
      else:
          print >>out,'no custom install'
      setup_tool = getToolByName(portal, 'portal_setup')
-    old_context = setup_tool.getImportContextID()
-    setup_tool.setImportContext('profile-ConceptCards:default')
-    setup_tool.runAllImportSteps()
-    setup_tool.setImportContext(old_context)
+    setup_tool.runAllImportStepsFromProfile('profile-
ConceptCards:default')
      print >> out, "Ran all GS import steps."
      return out.getvalue()


  def uninstall(self, reinstall=False):
---------- snip ----------

> Can it be fixed in AGX, or is the error elsewhere?

agx should probably be updated, since most of the removed function  
calls are now deprecated.

> Even if it can be fixed
> in AGX, it's a bit scary that products that were working earlier stop
> working in a minor release, no matter how "correct" it is.

that's true.  imho, GS should gracefully handle an empty context id  
for a little longer, even though the deprecation warnings have  
probably been around a while...


andi

--
zeidler it consulting - http://zitc.de/ - info@...
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.0.3 released! -- http://plone.org/products/plone



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

PGP.sig (193 bytes) Download Attachment
Wichert Akkerman

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Alexander Limi
Please don't cc me if you post through gmane - it creates useless emails
in my inbox to which I can't reply.

Previously Alexander Limi wrote:

> On Wed, 05 Dec 2007 01:36:26 -0800, Wichert Akkerman  
> <wichert@...> wrote:
>
> > Or c) what used to result in a silent but nasty problem now results in a
> > proper exception. And looking at that error message you are indeed
> > trying to set the context to "", which is obviously invalid.
>
> As an end-user, this is a regression from earlier 3.0.x versions, and at  
> least needs a recommended way to fix it. It's not obvious what to do at  
> this point.

It's a change but not a regression: the previous behaviour broke the
base profile, which is a pretty horrible thing to do and which can no
longer happen accidentily now.

> Can it be fixed in AGX, or is the error elsewhere? Even if it can be fixed  
> in AGX, it's a bit scary that products that were working earlier stop  
> working in a minor release, no matter how "correct" it is.

It wasn't working, but the breakage was silent and different. AGX needs
to use the non-deprecated UI, which fixes both this bug and the
deprecation warning you currently see.

WIchert.

--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Raphael Ritz

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
Wichert Akkerman wrote:

[..]

>
> It wasn't working, but the breakage was silent and different. AGX needs
> to use the non-deprecated UI, which fixes both this bug and the
> deprecation warning you currently see.
>

I strongly agree with Wichert here.

While it might have seemed to work previously it was just calling
for trouble later on.

I also agree that AGX is the right place to fix this.

The only thing I'm not sure about is whether we need to care
for backwards compatibility. If so, then something like

def install(self):
     out = StringIO()

     tool=getToolByName(self, "portal_setup")

     if getFSVersionTuple()[:3]>=(3,0,0):
         tool.runAllImportStepsFromProfile(
                 "profile-Products.PloneSVNaccess:default",
                 purge_old=False)
     else:
         plone_base_profileid = "profile-CMFPlone:plone"
         tool.setImportContext(plone_base_profileid)
         tool.setImportContext("profile-Products.PloneSVNaccess:default")
         tool.runAllImportSteps(purge_old=False)
         tool.setImportContext(plone_base_profileid)

     print >> out, "Successfully installed %s" % PROJECTNAME

     return out.getvalue()

(copied from my local repository but originally shamelessly stolen from
one of Wichert's products :-) )

might do it. (obviously, AGX would have to get the profile name right
but that's already the case anyway)

Raphael


> WIchert.
>


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Andreas Zeidler

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Alec Mitchell
hi alec,

that should be fixed in http://dev.plone.org/plone/changeset/18313 — assuming you're referring to the failures reported in http://dev.plone.org/plone/ticket/7435

cheers,


andi


On Dec 5, 2007 08:05 PM, Alec Mitchell wrote:
> Looks similar to the test error in CMFPlone 3.0 branch and trunk that
> cropped up somewhere around November 23.  Take a look in the
> nightlies.
>
> Alec
>
> On Dec 4, 2007 10:20 PM, Alexander Limi <limi@plone.org> wrote:
> > On Tue, 04 Dec 2007 22:17:45 -0800, Alexander Limi <limi@plone.org> wrote:
> >
> > >    Module Products.GenericSetup.tool, line 910, in _getImportContext
> > > KeyError: 'Unknown context '
> >
> > The only post I found with partial match was a recent discussion from
> > Wichert on the CMF list:
> > http://www.gossamer-threads.com/lists/zope/cmf/211385
> >
> > No idea if it's related at all. The error message output matches, at least.
Jens W. klein-2

Re: Product install regression?

Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Raphael Ritz
Raphael Ritz wrote:

> Wichert Akkerman wrote:
>
> [..]
>
>>
>> It wasn't working, but the breakage was silent and different. AGX needs
>> to use the non-deprecated UI, which fixes both this bug and the
>> deprecation warning you currently see.
>>
>
> I strongly agree with Wichert here.
>
> While it might have seemed to work previously it was just calling
> for trouble later on.
>
> I also agree that AGX is the right place to fix this.
>
> The only thing I'm not sure about is whether we need to care
> for backwards compatibility. If so, then something like
>
> def install(self):
>      out = StringIO()
>
>      tool=getToolByName(self, "portal_setup")
>
>      if getFSVersionTuple()[:3]>=(3,0,0):
>          tool.runAllImportStepsFromProfile(
>                  "profile-Products.PloneSVNaccess:default",
>                  purge_old=False)
>      else:
>          plone_base_profileid = "profile-CMFPlone:plone"
>          tool.setImportContext(plone_base_profileid)
>          tool.setImportContext("profile-Products.PloneSVNaccess:default")
>          tool.runAllImportSteps(purge_old=False)
>          tool.setImportContext(plone_base_profileid)
>
>      print >> out, "Successfully installed %s" % PROJECTNAME
>
>      return out.getvalue()
>
> (copied from my local repository but originally shamelessly stolen from
> one of Wichert's products :-) )
>
> might do it. (obviously, AGX would have to get the profile name right
> but that's already the case anyway)

If this is adviced best practice I agree to include it in AGX 2.0.

But does it mean we have to introduce Exentsions/install.py again? Can't
we deal all this from within a setuphandler (import step)?

At the moment we have an ugly not really good working workaround I'am not
very happy with. Real solutions welcome.

Jensens
--
/home/jensens/newsfooter.txt


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
1 2