Re: unreported upgrader errors
Sylvain Viollon <[email protected]> Thu, 5 May 2011 09:47:13 +0200
| Newsgroups | gmane.comp.web.zope.silva.devel |
|---|---|
| Organization | Infrae |
| Message-ID | <[email protected]> |
On Wed, 4 May 2011 15:23:50 -0500 Andrew Altepeter <[email protected]> wrote: > Hi Devs, > Hello, > I'm working on some Silva 2.3 upgraders for our environment. These > are *really* easy to write, so that's nice! Using silvaupdate is > also very easy, I like not having to fully start up zope and do the > upgrade in the ZMI. > > There have been a few times where I have a syntax error in my > upgrader. It seems that silvaupdate swallows the error, does not > report it, and proceeds to do the upgrade as usual. In this case, > since the import of the module failed, no upgraders (or any other > functionality) defined in the module are actually loaded. The syntax > error could be in any sort of python module -- it isn't reported. > > This was hard to troubleshoot until I thought, "does it start up > normally with paste serve"? > > Would it be possible to report zope startup errors of this sort when > using silvaupdate? > silvaupdate start Zope the same it is done with paster, however Zope is started with debug mode set to false. In production mode, Zope ignore products that have errors, and continue. That's the default behavior of Zope on that topic. silvaupdate already have a debug mode that prompt a PDB in case of errors triggered by the update code. I guess you could easily add the functionality you are talking about by changing line 55 in silva.core.upgrade.script the boot_zope from: boot_zope(options.config) to boot_zope(options.config, options.debug). And run silvaupdate with --debug. I already made the change in Silva 2.3 and 3.0 branches and pushed it in mercurial. Regards, Sylvain, -- Sylvain Viollon -- Infrae t +31 10 243 7051 -- http://infrae.com Hoevestraat 10 3033GC Rotterdam -- The Netherlands