Search code examples
plonezopebuildout

"instance" part is not deleted by buildout when switching to 2 Plone instances using buildout section extension


We're switching from one to two Zope instances for our productoin Plone deployment. I have the following buildout structure defined:

buildout.cfg

[buildout]
extends = app.cfg
... some environment specific stuff

app.cfg

[buildout]
extends = base.cfg

parts =
    zope2
    productdistros
    instance1
    instance2
    zopepy
    supervisor

[instance1]
<= instance
http-address = 18081

[instance2]
<= instance
http-address = 18082

base.cg

[buildout]
parts =
    zope2
    productdistros
    instance
    zopepy

... bulk of buildout configuration suitable for both server and development

Testing this I'd expect this buildout configuration to result in the existing instance part to be deleted and replaced with instance1 and instance2. However the instance part is not deleted - it can still be found in bin and parts directory.

[zopetest@dev home]$ bin/buildout
Updating zope2.
Updating fake eggs
Updating productdistros.
Updating instance1.
Updating instance2.
Updating instance.
Updating zopepy.
Updating supervisor.

I have a very similar set-up on a different zope instance that was configured this way from the start and it has no "instance" part.

We're running zc.buildout 1.4.4 with Python 2.4.6 building Plone 3.3.6.

I've tried the following with no change: * upgrading to buildout 1.5.2 * removing the parts assignment from base.cfg


Solution

  • This was in fact due to the zc.buildout automatic part selection feature

    When a section with a recipe is referred to, either through variable substitution or by an initializing recipe, the section is treated as a part and added to the part list before the referencing part

    I had the following section

    [zopepy]
    # For more information on this step and configuration options see:
    # http://pypi.python.org/pypi/zc.recipe.egg
    recipe = zc.recipe.egg
    eggs = ${instance:eggs}
    

    As it referenced the “instance” section “instance” was included in the list of parts.

    To fix I changed it to copy-paste the eggs value of instance

    eggs =
        Plone
        ${buildout:eggs}
    

    and then ran bin/buildout