Merge lp:~elachuni/ubuntu-webcatalog/configglue-1.0 into lp:ubuntu-webcatalog

Proposed by Anthony Lenton
Status: Merged
Approved by: Anthony Lenton
Approved revision: 95
Merged at revision: 105
Proposed branch: lp:~elachuni/ubuntu-webcatalog/configglue-1.0
Merge into: lp:ubuntu-webcatalog
Diff against target: 230 lines (+88/-84)
4 files modified
django_project/config/main.cfg (+21/-4)
django_project/settings.py (+5/-13)
setup.py (+2/-2)
src/webcatalog/schema.py (+60/-65)
To merge this branch: bzr merge lp:~elachuni/ubuntu-webcatalog/configglue-1.0
Reviewer Review Type Date Requested Status
Danny Tamez (community) Approve
Review via email: mp+99612@code.launchpad.net

Commit message

Migrated to configglue 1.0.

Description of the change

The last of our services that is missing to migrate to configglue 1.0.
The changes in this branch are along the same lines as thos applied for rnr-server on
https://code.launchpad.net/~elachuni/rnr-server/configglue-1.0/+merge/99427
or ubuntu-recommender on
https://code.launchpad.net/~elachuni/ubuntu-recommender/latest-configglue/+merge/95081

To post a comment you must log in.
Revision history for this message
Danny Tamez (zematynnad) wrote :

Looks great Anthony.

review: Approve
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

Attempt to merge into lp:ubuntu-webcatalog failed due to conflicts:

text conflict in src/webcatalog/schema.py

Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

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-03-07 22:57:41 +0000
3+++ django_project/config/main.cfg 2012-04-18 17:21:19 +0000
4@@ -67,11 +67,28 @@
5 name = webcatalog.db
6
7 [django_logging]
8-loggers = django_loggers
9 version = 1
10-disable_existing_loggers = False
11-
12-[django_loggers]
13+disable_existing_loggers = True
14+handlers = django_logging_handlers
15+loggers = django_logging_loggers
16+root = django_logging_root
17+
18+[django_logging_root]
19+level = WARNING
20+
21+[django_logging_loggers]
22+django = django_logger
23+
24+[django_logger]
25+handlers = null
26+level = WARNING
27+
28+[django_logging_handlers]
29+null = django_null_logging_handler
30+
31+[django_null_logging_handler]
32+level = WARNING
33+class = django.utils.log.NullHandler
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-06-18 22:24:08 +0000
40+++ django_project/settings.py 2012-04-18 17:21:19 +0000
41@@ -2,23 +2,15 @@
42
43 import os.path
44
45-from configglue.pyschema import SchemaConfigParser
46-from django_configglue.utils import update_settings
47-
48+from django_configglue.utils import configglue
49 from webcatalog.schema import WebCatalogSchema
50
51
52 # get absolute path for config files
53 current_dir = os.path.dirname(os.path.abspath(__file__))
54-config_files = map(lambda x: os.path.join(current_dir, x),
55+config_files = [path for path in map(lambda x: os.path.join(current_dir, x),
56 ['config/main.cfg', '../../local_config/local.cfg',
57 'local.cfg'])
58-
59-# parse config files
60-parser = SchemaConfigParser(WebCatalogSchema())
61-parser.read(config_files)
62-update_settings(parser, locals())
63-
64-# keep parser reference
65-__CONFIGGLUE_PARSER__ = parser
66-
67+ if os.path.exists(path)]
68+
69+configglue(WebCatalogSchema, config_files, __name__)
70\ No newline at end of file
71
72=== modified file 'setup.py'
73--- setup.py 2012-04-17 04:44:33 +0000
74+++ setup.py 2012-04-18 17:21:19 +0000
75@@ -36,8 +36,8 @@
76 'django',
77 'setuptools',
78 'south==0.7.3',
79- 'configglue==0.10',
80- 'django-configglue==0.4',
81+ 'configglue==1.0.1',
82+ 'django-configglue==0.6.1',
83 'django-openid-auth==0.2',
84 'django-piston==0.2.3',
85 'django-preflight',
86
87=== modified file 'src/webcatalog/schema.py'
88--- src/webcatalog/schema.py 2012-04-05 01:09:37 +0000
89+++ src/webcatalog/schema.py 2012-04-18 17:21:19 +0000
90@@ -17,80 +17,75 @@
91
92 """configglue schema for the Apps Directory."""
93
94-from configglue.pyschema import ConfigSection
95-from configglue.pyschema.options import (
96- BoolConfigOption,
97- DictConfigOption,
98- IntConfigOption,
99- LinesConfigOption,
100- StringConfigOption,
101- )
102+
103+import django
104+from configglue import schema
105 from django_configglue.schema import schemas
106
107-DjangoSchema = schemas.get('1.3')
108+DjangoSchema = schemas.get(django.get_version())
109
110
111 class WebCatalogSchema(DjangoSchema):
112 """Config options specific to the web catalog."""
113 # default section
114- extra_pythonpath = LinesConfigOption(item=StringConfigOption())
115- pgconnect_timeout = IntConfigOption(default=10)
116- should_serve_https = BoolConfigOption()
117+ extra_pythonpath = schema.ListOption(item=schema.StringOption())
118+ pgconnect_timeout = schema.IntOption(default=10)
119+ should_serve_https = schema.BoolOption()
120
121- oops = ConfigSection()
122- oops.oops_dir = StringConfigOption(help='Absolute path to the directory'
123+ class oops(schema.Section):
124+ oops_dir = schema.StringOption(help='Absolute path to the directory'
125 ' oops reports will be stored in')
126
127- openid = ConfigSection()
128- openid.openid_sso_server_url = StringConfigOption()
129- openid.openid_create_users = BoolConfigOption()
130- openid.openid_update_details_from_sreg = BoolConfigOption()
131- openid.openid_launchpad_teams_mapping = DictConfigOption()
132- openid.openid_sreg_extra_fields = LinesConfigOption(
133- item=StringConfigOption())
134- openid.openid_launchpad_staff_teams = LinesConfigOption(
135- item=StringConfigOption())
136-
137- webcatalog = ConfigSection()
138- webcatalog.serve_site_media = BoolConfigOption(default=True)
139- webcatalog.sca_api_url = StringConfigOption()
140- webcatalog.disk_apt_cache_location = StringConfigOption()
141- webcatalog.default_distro = StringConfigOption()
142- webcatalog.page_batch_size = IntConfigOption(default=20)
143- webcatalog.preload_api_service_roots = BoolConfigOption()
144- webcatalog.oauth_data_store = StringConfigOption(
145- default='webcatalog.models.oauthtoken.DataStore')
146- webcatalog.convoy_root = StringConfigOption()
147- webcatalog.featured_apps = LinesConfigOption(item=StringConfigOption(),
148- default=[])
149- webcatalog.number_top_rated_apps = IntConfigOption(default=18)
150- webcatalog.screenshots_base_url = StringConfigOption(
151- default='http://screenshots.ubuntu.com/')
152-
153- google = ConfigSection()
154- google.google_analytics_id = StringConfigOption()
155- google.secondary_google_analytics_id = StringConfigOption()
156-
157- logging = ConfigSection()
158- logging.webapp_logging_config = StringConfigOption()
159+ class openid(schema.Section):
160+ openid_sso_server_url = schema.StringOption()
161+ openid_create_users = schema.BoolOption()
162+ openid_update_details_from_sreg = schema.BoolOption()
163+ openid_launchpad_teams_mapping = schema.DictOption()
164+ openid_sreg_extra_fields = schema.ListOption(
165+ item=schema.StringOption())
166+ openid_launchpad_staff_teams = schema.ListOption(
167+ item=schema.StringOption())
168+
169+ class webcatalog(schema.Section):
170+ serve_site_media = schema.BoolOption(default=True)
171+ sca_api_url = schema.StringOption()
172+ disk_apt_cache_location = schema.StringOption()
173+ default_distro = schema.StringOption()
174+ page_batch_size = schema.IntOption(default=20)
175+ preload_api_service_roots = schema.BoolOption()
176+ oauth_data_store = schema.StringOption(
177+ default='webcatalog.models.oauthtoken.DataStore')
178+ convoy_root = schema.StringOption()
179+ featured_apps = schema.ListOption(item=schema.StringOption(),
180+ default=[])
181+ number_top_rated_apps = schema.IntOption(default=8)
182+ screenshots_base_url = schema.StringOption(
183+ default='http://screenshots.ubuntu.com/')
184+
185+ class google(schema.Section):
186+ google_analytics_id = schema.StringOption()
187+ secondary_google_analytics_id = schema.StringOption()
188+
189+ class logging(schema.Section):
190+ webapp_logging_config = schema.StringOption()
191
192 # preflight
193- preflight = ConfigSection()
194- preflight.preflight_base_template = StringConfigOption(
195- default="webcatalog/base.html")
196-
197- rnr = ConfigSection()
198- rnr.rnr_service_root = StringConfigOption(
199- default="http://reviews.ubuntu.com/reviews/api/1.0")
200- rnr.reviews_cache_timeout = IntConfigOption(default=60 * 15)
201-
202- sso_api = ConfigSection()
203- sso_api.sso_api_service_root = StringConfigOption()
204- sso_api.sso_api_auth_username = StringConfigOption()
205- sso_api.sso_api_auth_password = StringConfigOption()
206- sso_api.sso_api_identity_prefix = StringConfigOption()
207- sso_api.sso_auth_mode_no_ubuntu_sso_plaintext_only = BoolConfigOption()
208- sso_api.token_cache_expiry_hours = IntConfigOption(default=4)
209-
210- email = ConfigSection()
211- email.noreply_from_address = StringConfigOption()
212+ class preflight(schema.Section):
213+ preflight_base_template = schema.StringOption(
214+ default="webcatalog/base.html")
215+
216+ class rnr(schema.Section):
217+ rnr_service_root = schema.StringOption(
218+ default="http://reviews.ubuntu.com/reviews/api/1.0")
219+ reviews_cache_timeout = schema.IntOption(default=60 * 15)
220+
221+ class sso_api(schema.Section):
222+ sso_api_service_root = schema.StringOption()
223+ sso_api_auth_username = schema.StringOption()
224+ sso_api_auth_password = schema.StringOption()
225+ sso_api_identity_prefix = schema.StringOption()
226+ sso_auth_mode_no_ubuntu_sso_plaintext_only = schema.BoolOption()
227+ token_cache_expiry_hours = schema.IntOption(default=4)
228+
229+ class email(schema.Section):
230+ noreply_from_address = schema.StringOption()

Subscribers

People subscribed via source and target branches