Merge lp:~gary/launchpad/bug656213 into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Leonard Richardson
Approved revision: no longer in the source branch.
Merged at revision: 11704
Proposed branch: lp:~gary/launchpad/bug656213
Merge into: lp:launchpad
Diff against target: 53 lines (+14/-14)
2 files modified
buildout.cfg (+3/-3)
lib/lp_sitecustomize.py (+11/-11)
To merge this branch: bzr merge lp:~gary/launchpad/bug656213
Reviewer Review Type Date Requested Status
Leonard Richardson (community) Approve
Review via email: mp+38242@code.launchpad.net

Commit message

Allow .lpconfig to be honored if initial configuration is "development"

Description of the change

This branch changes the buildout to address the linked bug.

stub has already approved the branch in the bug report; this is an official request that is friendly to our various bits of automation.

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) :
review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

+ # See bug 656213 for why we do this carefully.

I'd really appreciate a little more info here - its hard to lookup a
bug when on a plane/train or automobile.

-Rob

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout.cfg'
--- buildout.cfg 2010-09-06 21:13:14 +0000
+++ buildout.cfg 2010-10-12 16:01:07 +0000
@@ -51,9 +51,9 @@
51interpreter = py51interpreter = py
52# Note that any indentation is lost in initialization blocks.52# Note that any indentation is lost in initialization blocks.
53initialization =53initialization =
54 import os54 # See buildout.cfg, [scripts] section, "initialization" key.
55 os.environ.setdefault('LPCONFIG', '${configuration:instance_name}')55 from lp_sitecustomize import main
56 import lp_sitecustomize # Initializes LP environment.56 main('${configuration:instance_name}') # Initializes LP environment.
57entry-points = stxdocs=zope.configuration.stxdocs:main57entry-points = stxdocs=zope.configuration.stxdocs:main
58 googletestservice=canonical.launchpad.testing.googletestservice:main58 googletestservice=canonical.launchpad.testing.googletestservice:main
59 windmill=windmill.bin.windmill_bin:main59 windmill=windmill.bin.windmill_bin:main
6060
=== modified file 'lib/lp_sitecustomize.py'
--- lib/lp_sitecustomize.py 2010-09-27 08:46:26 +0000
+++ lib/lp_sitecustomize.py 2010-10-12 16:01:07 +0000
@@ -87,15 +87,17 @@
87 module="Crypto")87 module="Crypto")
8888
8989
90def main():90def main(instance_name):
91 # Note that we configure the LPCONFIG environmental variable in the91 # This is called by our custom buildout-generated sitecustomize.py
92 # custom buildout-generated sitecustomize.py in92 # in parts/scripts/sitecustomize.py. The instance name is sent to
93 # parts/scripts/sitecustomize.py rather than here. This is because93 # buildout from the Makefile, and then inserted into
94 # the instance name, ${configuration:instance_name}, is dynamic,94 # sitecustomize.py. See buildout.cfg in the "initialization" value
95 # sent to buildout from the Makefile. See buildout.cfg in the95 # of the [scripts] section for the code that goes into this custom
96 # initialization value of the [scripts] section for the code that96 # sitecustomize.py. We do all actual initialization here, in a more
97 # goes into this custom sitecustomize.py. We do as much other97 # visible place.
98 # initialization as possible here, in a more visible place.98 if instance_name and instance_name != 'development':
99 # See bug 656213 for why we do this carefully.
100 os.environ.setdefault('LPCONFIG', instance_name)
99 os.environ['STORM_CEXTENSIONS'] = '1'101 os.environ['STORM_CEXTENSIONS'] = '1'
100 add_custom_loglevels()102 add_custom_loglevels()
101 customizeMimetypes()103 customizeMimetypes()
@@ -109,5 +111,3 @@
109 silence_bzr_logger()111 silence_bzr_logger()
110 silence_zcml_logger()112 silence_zcml_logger()
111 silence_transaction_logger()113 silence_transaction_logger()
112
113main()