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
1=== modified file 'buildout.cfg'
2--- buildout.cfg 2010-09-06 21:13:14 +0000
3+++ buildout.cfg 2010-10-12 16:01:07 +0000
4@@ -51,9 +51,9 @@
5 interpreter = py
6 # Note that any indentation is lost in initialization blocks.
7 initialization =
8- import os
9- os.environ.setdefault('LPCONFIG', '${configuration:instance_name}')
10- import lp_sitecustomize # Initializes LP environment.
11+ # See buildout.cfg, [scripts] section, "initialization" key.
12+ from lp_sitecustomize import main
13+ main('${configuration:instance_name}') # Initializes LP environment.
14 entry-points = stxdocs=zope.configuration.stxdocs:main
15 googletestservice=canonical.launchpad.testing.googletestservice:main
16 windmill=windmill.bin.windmill_bin:main
17
18=== modified file 'lib/lp_sitecustomize.py'
19--- lib/lp_sitecustomize.py 2010-09-27 08:46:26 +0000
20+++ lib/lp_sitecustomize.py 2010-10-12 16:01:07 +0000
21@@ -87,15 +87,17 @@
22 module="Crypto")
23
24
25-def main():
26- # Note that we configure the LPCONFIG environmental variable in the
27- # custom buildout-generated sitecustomize.py in
28- # parts/scripts/sitecustomize.py rather than here. This is because
29- # the instance name, ${configuration:instance_name}, is dynamic,
30- # sent to buildout from the Makefile. See buildout.cfg in the
31- # initialization value of the [scripts] section for the code that
32- # goes into this custom sitecustomize.py. We do as much other
33- # initialization as possible here, in a more visible place.
34+def main(instance_name):
35+ # This is called by our custom buildout-generated sitecustomize.py
36+ # in parts/scripts/sitecustomize.py. The instance name is sent to
37+ # buildout from the Makefile, and then inserted into
38+ # sitecustomize.py. See buildout.cfg in the "initialization" value
39+ # of the [scripts] section for the code that goes into this custom
40+ # sitecustomize.py. We do all actual initialization here, in a more
41+ # visible place.
42+ if instance_name and instance_name != 'development':
43+ # See bug 656213 for why we do this carefully.
44+ os.environ.setdefault('LPCONFIG', instance_name)
45 os.environ['STORM_CEXTENSIONS'] = '1'
46 add_custom_loglevels()
47 customizeMimetypes()
48@@ -109,5 +111,3 @@
49 silence_bzr_logger()
50 silence_zcml_logger()
51 silence_transaction_logger()
52-
53-main()