Merge lp:~elachuni/ubuntu-recommender/latest-configglue into lp:ubuntu-recommender

Proposed by Anthony Lenton
Status: Merged
Approved by: Anthony Lenton
Approved revision: 43
Merged at revision: 43
Proposed branch: lp:~elachuni/ubuntu-recommender/latest-configglue
Merge into: lp:ubuntu-recommender
Diff against target: 182 lines (+70/-63)
4 files modified
django_project/config/main.cfg (+23/-3)
django_project/settings.py (+2/-8)
requirements.txt (+2/-2)
src/recommender/schema.py (+43/-50)
To merge this branch: bzr merge lp:~elachuni/ubuntu-recommender/latest-configglue
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+95081@code.launchpad.net

Commit message

Moved over to configglue 1.0.1.

Description of the change

This branch moves us over to configglue 1.0.1.

Proper logging configuration will need to be taken care of in the deployment config branch, together with code for making configglue a source dep.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

Post-hoc approval :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/config/main.cfg'
2--- django_project/config/main.cfg 2012-02-15 14:16:28 +0000
3+++ django_project/config/main.cfg 2012-02-29 00:25:23 +0000
4@@ -60,9 +60,29 @@
5 host = /tmp
6
7 [django_logging]
8-loggers = django_loggers
9-
10-[django_loggers]
11+version = 1
12+disable_existing_loggers = True
13+handlers = django_logging_handlers
14+loggers = django_logging_loggers
15+root = django_logging_root
16+
17+[django_logging_root]
18+level = WARNING
19+
20+[django_logging_loggers]
21+django = django_logger
22+
23+[django_logger]
24+handlers = null
25+level = WARNING
26+
27+[django_logging_handlers]
28+null = django_null_logging_handler
29+
30+[django_null_logging_handler]
31+level = WARNING
32+class = django.utils.log.NullHandler
33+
34
35 [openid]
36 openid_sso_server_url = https://login.staging.ubuntu.com
37
38=== modified file 'django_project/settings.py'
39--- django_project/settings.py 2011-12-06 15:07:51 +0000
40+++ django_project/settings.py 2012-02-29 00:25:23 +0000
41@@ -2,7 +2,7 @@
42
43 import os.path
44
45-from configglue.pyschema import SchemaConfigParser
46+from django_configglue.utils import configglue
47 from django_configglue.utils import update_settings
48
49 from recommender.schema import UbuntuRecommenderSchema
50@@ -14,10 +14,4 @@
51 ['config/main.cfg', '../../local_config/local.cfg',
52 '../../../local_config/local.cfg', 'local.cfg'])
53
54-# parse config files
55-parser = SchemaConfigParser(UbuntuRecommenderSchema())
56-parser.read(config_files)
57-update_settings(parser, locals())
58-
59-# keep parser reference
60-__CONFIGGLUE_PARSER__ = parser
61+configglue(UbuntuRecommenderSchema, config_files, __name__)
62
63=== modified file 'requirements.txt'
64--- requirements.txt 2012-02-15 14:09:20 +0000
65+++ requirements.txt 2012-02-29 00:25:23 +0000
66@@ -1,7 +1,7 @@
67-configglue==0.10
68+configglue==1.0.1
69 coverage
70 django==1.3
71-django-configglue==0.4
72+django-configglue==0.6.1
73 -e bzr+http://bazaar.launchpad.net/~canonical-isd-hackers/django-pgtools/trunk
74 -e bzr+http://bazaar.launchpad.net/~django-openid-auth/django-openid-auth/trunk
75 django-piston==0.2.2.1
76
77=== modified file 'src/recommender/schema.py'
78--- src/recommender/schema.py 2012-02-17 12:09:00 +0000
79+++ src/recommender/schema.py 2012-02-29 00:25:23 +0000
80@@ -25,59 +25,52 @@
81 ]
82
83 import django
84-from configglue.pyschema import ConfigSection
85-from configglue.pyschema.options import (
86- BoolConfigOption,
87- DictConfigOption,
88- IntConfigOption,
89- LinesConfigOption,
90- StringConfigOption,
91- )
92+from configglue import schema
93 from django_configglue.schema import schemas
94
95 DjangoSchema = schemas.get(django.get_version())
96
97
98 class UbuntuRecommenderSchema(DjangoSchema):
99- openid = ConfigSection()
100- openid.openid_sso_server_url = StringConfigOption()
101- openid.openid_create_users = BoolConfigOption()
102- openid.openid_update_details_from_sreg = BoolConfigOption()
103- openid.multilang_op_endpoints = BoolConfigOption()
104- openid.openid_launchpad_teams_mapping = DictConfigOption()
105- openid.openid_sreg_extra_fields = LinesConfigOption(
106- item=StringConfigOption())
107- openid.openid_sreg_required_fields = LinesConfigOption(
108- item=StringConfigOption())
109- openid.openid_launchpad_staff_teams = LinesConfigOption(
110- item=StringConfigOption())
111-
112- sso_api = ConfigSection()
113- sso_api.sso_api_service_root = StringConfigOption()
114- sso_api.sso_api_auth_username = StringConfigOption()
115- sso_api.sso_api_auth_password = StringConfigOption()
116- sso_api.sso_api_identity_prefix = StringConfigOption()
117- sso_api.sso_auth_mode_no_ubuntu_sso_plaintext_only = BoolConfigOption()
118-
119- recommender = ConfigSection()
120- recommender.oauth_data_store = StringConfigOption()
121- recommender.pgconnect_timeout = IntConfigOption(default=10)
122- recommender.extra_pythonpath = LinesConfigOption(item=StringConfigOption())
123- recommender.use_https = BoolConfigOption()
124- recommender.recommendation_limit = IntConfigOption(default=10)
125- recommender.recommendation_min_rating = IntConfigOption(default=3)
126- recommender.cache_results_seconds = IntConfigOption(default=300)
127- recommender.enable_gzipped_content = BoolConfigOption(default=True)
128-
129- preflight = ConfigSection()
130- preflight.preflight_base_template = StringConfigOption(
131- default='preflight/base.html')
132- preflight.preflight_table_class = StringConfigOption(
133- default='listing')
134-
135- data_import = ConfigSection()
136- data_import.rnr_api = StringConfigOption(
137- default='https://reviews.ubuntu.com/reviews/api/1.0')
138-
139- logging = ConfigSection()
140- logging.webapp_logging_config = StringConfigOption(fatal=True)
141+ class openid(schema.Section):
142+ openid_sso_server_url = schema.StringOption()
143+ openid_create_users = schema.BoolOption()
144+ openid_update_details_from_sreg = schema.BoolOption()
145+ multilang_op_endpoints = schema.BoolOption()
146+ openid_launchpad_teams_mapping = schema.DictOption()
147+ openid_sreg_extra_fields = schema.ListOption(
148+ item=schema.StringOption())
149+ openid_sreg_required_fields = schema.ListOption(
150+ item=schema.StringOption())
151+ openid_launchpad_staff_teams = schema.ListOption(
152+ item=schema.StringOption())
153+
154+ class sso_api(schema.Section):
155+ sso_api_service_root = schema.StringOption()
156+ sso_api_auth_username = schema.StringOption()
157+ sso_api_auth_password = schema.StringOption()
158+ sso_api_identity_prefix = schema.StringOption()
159+ sso_auth_mode_no_ubuntu_sso_plaintext_only = schema.BoolOption()
160+
161+ class recommender(schema.Section):
162+ oauth_data_store = schema.StringOption()
163+ pgconnect_timeout = schema.IntOption(default=10)
164+ extra_pythonpath = schema.ListOption(item=schema.StringOption())
165+ use_https = schema.BoolOption()
166+ recommendation_limit = schema.IntOption(default=10)
167+ recommendation_min_rating = schema.IntOption(default=3)
168+ cache_results_seconds = schema.IntOption(default=300)
169+ enable_gzipped_content = schema.BoolOption(default=True)
170+
171+ class preflight(schema.Section):
172+ preflight_base_template = schema.StringOption(
173+ default='preflight/base.html')
174+ preflight_table_class = schema.StringOption(
175+ default='listing')
176+
177+ class data_import(schema.Section):
178+ rnr_api = schema.StringOption(
179+ default='https://reviews.ubuntu.com/reviews/api/1.0')
180+
181+ class logging(schema.Section):
182+ webapp_logging_config = schema.StringOption(fatal=True)

Subscribers

People subscribed via source and target branches