[Zope-CMF] Re: GenericSetup can loose the base profile

Tres Seaver tseaver at palladion.com
Mon Nov 19 13:22:01 EST 2007

Hash: SHA1

Wichert Akkerman wrote:
> We are seeing a very interesting problem with the current profile
> handling in GenericSetup. This is the scenario:
> - we load a profile using runAllImportStepsFromProfile
> - one of the import steps installs a product using CMFQuickInstaller
> - this product loads another GenericSetup profile, but does a
>   getImportContextID() and setImportContext() to make sure GS context
>   is not destroyed during the process.
> what happens is that runAllImportStepsFromProfile does not set
> _import_context_id on the setup tool, so we get the default value: an
> empty string. setImportContext() checks if the context id starts with
> profile- and if not assumes we are setting the base profile. Result:
> the base profile has disappeared.
> What surprised me was that apparently "" *is* a valid profile id:
> _getImportContext assumes that anything that does not start with
> profile- is a snapshot profile. But it will also destroy the context
> id in that scenario:
>     # else snapshot
>     context_id = context_id[len('snapshot-'):]
> I modified that code to explicitly check for
> context_id.startswith("snapshot-") (see patch below) but that broke a
> number of tests which were using an context id of "" to get an empty
> snapshot context.  As far as I can see nobody does that outside of the
> tests so there should no risk of unexpected breakage anywhere.
> Does anyone have a good reason not to make this change?

+1.  It looks like your branch checkin did something funny with
'www/sutImportSteps.zpt' (deleted, readded?  I'm not sure).  Anyway,
except for not knowing what that change meant, I'm fine with merging
your branch to the 2.1 branch and the trunk.

- --
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Zope-CMF mailing list