Merge lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools

Proposed by James Westby on 2012-12-06
Status: Merged
Approved by: James Westby on 2012-12-06
Approved revision: 54
Merged at revision: 53
Proposed branch: lp:~james-w/python-oops-tools/prod-deploy
Merge into: lp:python-oops-tools
Diff against target: 101 lines (+22/-4)
5 files modified
buildout-templates/src/oopstools/settings.py.in (+14/-1)
production.cfg.example (+2/-1)
setup.py (+2/-0)
src/oopstools/urls.py (+3/-2)
versions.cfg (+1/-0)
To merge this branch: bzr merge lp:~james-w/python-oops-tools/prod-deploy
Reviewer Review Type Date Requested Status
Martin Albisetti (community) 2012-12-06 Approve on 2012-12-06
Review via email: mp+138571@code.launchpad.net

Commit message

Add django_openid_auth.

Our production deployment hacks things such that django_openid_auth is used.
This adds it for real.

In addition it adds the common pattern of allowing a local_settings.py
that overrides values in settings.py so that prod can configure things like
the SSO server and the team mappings.

Description of the change

Hi,

This is a step towards cleaning up the prod deploy.

Currently prod runs non-trunk code as it changes a couple of files
to add openid support.

This branch adds the basic support for openid, and allows for configuration
in prod without having to change versioned files. The commit message
has more rationale about the individual changes.

Thanks,

James

To post a comment you must log in.
Martin Albisetti (beuno) :
review: Approve
Launchpad PQM Bot (launchpad-pqm) wrote :

The attempt to merge lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools failed.Below is the output from the failed tests.

find . -type f -name '*.py[co]' -exec rm -f {} \;
rm -f bin/buildout
rm -f src/oopstools/settings.py
bzr clean-tree --unknown --force
bzr up download-cache
python bootstrap.py \
  --setup-source=download-cache/ez_setup.py \
  --download-base=download-cache/dist --eggs=eggs
Download error: [Errno 111] Connection refused -- Some packages may not be found!
Download error: [Errno 111] Connection refused -- Some packages may not be found!
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/buildout'.
bin/buildout configuration:db-port=5433
Develop: '/home/pqm/pqm-workdir/oops-tools/.'
Couldn't find index page for 'django-openid-auth' (maybe misspelled?)
Getting distribution for 'django-openid-auth==0.4'.

W: line 4 [buildbot-staging]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 2 [pqm]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 3 [pqm-oops-tools]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 1 [precise]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
I: [pqm-oops-tools chroot] Running command: "cd /home/pqm/pqm-workdir/oops-tools && make check"
Nothing to delete.
Tree is up to date at revision 533 of branch http://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk
While:
  Installing.
  Getting section filetemplates.
  Initializing part filetemplates.
  Getting distribution for 'django-openid-auth==0.4'.
Error: Couldn't find a distribution for 'django-openid-auth==0.4'.
make: *** [bin/buildout] Error 1

James Westby (james-w) wrote :

Oh yeah, I can't land this until we fix the filename of django-openid-auth in the download-cache.

Thanks,

James

Launchpad PQM Bot (launchpad-pqm) wrote :
Download full text (87.6 KiB)

The attempt to merge lp:~james-w/python-oops-tools/prod-deploy into lp:python-oops-tools failed.Below is the output from the failed tests.

find . -type f -name '*.py[co]' -exec rm -f {} \;
rm -f bin/buildout
rm -f src/oopstools/settings.py
bzr clean-tree --unknown --force
bzr up download-cache
python bootstrap.py \
  --setup-source=download-cache/ez_setup.py \
  --download-base=download-cache/dist --eggs=eggs
Download error: [Errno 111] Connection refused -- Some packages may not be found!
Download error: [Errno 111] Connection refused -- Some packages may not be found!
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/buildout'.
bin/buildout configuration:db-port=5433
Develop: '/home/pqm/pqm-workdir/oops-tools/.'
Getting distribution for 'django-openid-auth==0.4'.
zip_safe flag not set; analyzing archive contents...
Got django-openid-auth 0.4.
Uninstalling filetemplates.
Updating scripts.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/load_sample_data'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/prune'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/analyse_error_reports'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/dir_finder'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/amqp2disk'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/update_db'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/report'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/graph_report'.
Generated interpreter '/home/pqm/pqm-workdir/oops-tools/bin/py'.
Installing filetemplates.
Updating django.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/django'.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/test'.
Updating docs.
Generated script '/home/pqm/pqm-workdir/oops-tools/bin/docs'.
Updating tags.
bin/test
Creating test database for alias 'default'...
Destroying test database for alias 'default'...

W: line 4 [buildbot-staging]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 2 [pqm]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 3 [pqm-oops-tools]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
W: line 1 [precise]: Deprecated key 'location' used
I: This option will be removed in the future; please update your configuration
I: [pqm-oops-tools chroot] Running command: "cd /home/pqm/pqm-workdir/oops-tools && make check"
Nothing to delete.
R dist/django-openid-auth_0.4.tar.gz => dist/django-openid-auth-0.4.tar.gz
All changes applied successfully.
Updated to revision 534 of branch http://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk
F......F.....FFF.....................EEEEE
======================================================================
ERROR: test_inactive_report (test_report.ReportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pqm/pqm-workdir/oops-tools/src/oopstools/oops/test/test_report.py", line 39, in test_inactive_report
    resp = self.client.get('/reports/%s/' % (report_name...

54. By James Westby on 2012-12-06

Add python-openid as django_openid_auth doesn't depend on it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/src/oopstools/settings.py.in'
2--- buildout-templates/src/oopstools/settings.py.in 2012-09-23 00:52:28 +0000
3+++ buildout-templates/src/oopstools/settings.py.in 2012-12-06 22:14:36 +0000
4@@ -111,8 +111,9 @@
5 'django.contrib.sessions',
6 'django.contrib.sites',
7 'django.contrib.admin',
8+ 'django_openid_auth',
9 'oopstools.oops',
10- 'south'
11+ 'south',
12 )
13
14 OOPS_WEB_AMQP_HOST = '${configuration:oops-web-amqp-host}'
15@@ -121,3 +122,15 @@
16 OOPS_WEB_AMQP_VHOST = '${configuration:oops-web-amqp-vhost}'
17 OOPS_WEB_AMQP_EXCHANGE = '${configuration:oops-web-amqp-exchange}'
18 OOPS_WEB_AMQP_ROUTING = '${configuration:oops-web-amqp-routing}'
19+
20+AUTHENTICATION_BACKENDS = (
21+ 'django.contrib.auth.backends.ModelBackend',
22+ 'django_openid_auth.auth.OpenIDBackend',
23+)
24+LOGIN_URL = '/openid/login/'
25+LOGIN_REDIRECT_URL = '/admin/'
26+
27+try:
28+ from oopstools.local_settings import *
29+except ImportError:
30+ pass
31
32=== renamed file 'production.cfg' => 'production.cfg.example'
33--- production.cfg 2011-10-13 20:18:51 +0000
34+++ production.cfg.example 2012-12-06 22:14:36 +0000
35@@ -1,4 +1,5 @@
36-# Buildout configuration for the production deployment
37+# Example Buildout configuration for a production deployment.
38+# Rename the file to production.cfg and fill in the details.
39 [buildout]
40 extends = buildout.cfg
41
42
43=== modified file 'setup.py'
44--- setup.py 2012-09-19 03:44:41 +0000
45+++ setup.py 2012-12-06 22:14:36 +0000
46@@ -51,6 +51,7 @@
47 install_requires=[
48 'BeautifulSoup',
49 'django',
50+ 'django_openid_auth',
51 'fixtures',
52 'launchpadlib',
53 'lazr.config',
54@@ -60,6 +61,7 @@
55 'oops-wsgi',
56 'oops-timeline',
57 'psycopg2',
58+ 'python-openid',
59 'pytz',
60 'setuptools',
61 'South',
62
63=== modified file 'src/oopstools/urls.py'
64--- src/oopstools/urls.py 2011-10-13 20:18:51 +0000
65+++ src/oopstools/urls.py 2012-12-06 22:14:36 +0000
66@@ -13,7 +13,7 @@
67 # You should have received a copy of the GNU Affero General Public License
68 # along with this program. If not, see <http://www.gnu.org/licenses/>.
69
70-from django.conf.urls.defaults import *
71+from django.conf.urls.defaults import patterns, include, url
72 from django.conf import settings
73
74 # Uncomment the next two lines to enable the admin:
75@@ -24,7 +24,7 @@
76 # Example:
77 # (r'^oopstools/', include('oopstools.foo.urls')),
78
79- # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
80+ # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
81 # to INSTALLED_APPS to enable admin documentation:
82 # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
83
84@@ -39,4 +39,5 @@
85 (r'^oops[.py]*/meta$', 'oopstools.oops.views.meta'),
86 (r'^oops/static/(?P<path>.*)$', 'django.views.static.serve',
87 {'document_root': settings.STATIC_DOC_ROOT}),
88+ url(r'^auth/', include('django_openid_auth.urls')),
89 )
90
91=== modified file 'versions.cfg'
92--- versions.cfg 2012-12-06 21:01:15 +0000
93+++ versions.cfg 2012-12-06 22:14:36 +0000
94@@ -14,6 +14,7 @@
95 Sphinx = 1.0.7
96 sqlparse = 0.1.3
97 django = 1.3.3
98+django-openid-auth = 0.4
99 djangorecipe = 1.3
100 distribute = 0.6.12
101 docutils = 0.6

Subscribers

People subscribed via source and target branches

to all changes: