Merge lp:~allenap/maas/oops-did-it-again--1.7 into lp:maas/1.7

Proposed by Gavin Panella
Status: Merged
Merged at revision: 3348
Proposed branch: lp:~allenap/maas/oops-did-it-again--1.7
Merge into: lp:maas/1.7
Diff against target: 397 lines (+11/-201)
12 files modified
docs/development/cluster-bootstrap.rst (+1/-1)
etc/maas/pserv.yaml (+0/-11)
required-packages/base (+1/-5)
setup.py (+0/-3)
src/maas/settings.py (+0/-3)
src/maasserver/management/commands/runserver.py (+0/-45)
src/maasserver/tests/test_runserver.py (+0/-38)
src/provisioningserver/config.py (+6/-1)
src/provisioningserver/plugin.py (+1/-54)
src/provisioningserver/tests/test_config.py (+0/-2)
src/provisioningserver/tests/test_plugin.py (+1/-1)
src/provisioningserver/tests/test_plugin_services.py (+1/-37)
To merge this branch: bzr merge lp:~allenap/maas/oops-did-it-again--1.7
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+251450@code.launchpad.net

Commit message

Remove all OOPS reporting.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

This is a back-port from trunk, so self-reviewing.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (29.5 KiB)

The attempt to merge lp:~allenap/maas/oops-did-it-again--1.7 into lp:maas/1.7 failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security Release.gpg
Hit http://security.ubuntu.com trusty-security Release
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:1 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:2 http://nova.clouds.archive.ubuntu.com trusty-updates Release [62.0 kB]
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [181 kB]
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [105 kB]
Get:5 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [446 kB]
Get:6 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [254 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,049 kB in 2s (353 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bson python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-openssl python-paramiko python-pexpect python-pip python-pocket-lint python-psycopg2 python-pyinotify python-seamicroclient python-simplejson python...

Revision history for this message
Gavin Panella (allenap) wrote :

Landed this direct (after running tests locally).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/development/cluster-bootstrap.rst'
2--- docs/development/cluster-bootstrap.rst 2014-10-09 21:53:36 +0000
3+++ docs/development/cluster-bootstrap.rst 2015-03-02 14:13:04 +0000
4@@ -29,7 +29,7 @@
5
6 #. ``ClusterClientService`` starts.
7
8-#. Services other than log and oops are **not** started.
9+#. Services other than ``log`` are **not** started.
10
11 #. Wait for a connection to the region to become available.
12
13
14=== modified file 'etc/maas/pserv.yaml'
15--- etc/maas/pserv.yaml 2014-08-13 21:49:35 +0000
16+++ etc/maas/pserv.yaml 2015-03-02 14:13:04 +0000
17@@ -8,17 +8,6 @@
18 # logfile: "pserv.log"
19 logfile: "/dev/null"
20
21-## OOPS configuration (optional).
22-#
23-oops:
24- ## Directory in which to place OOPS reports. Must not contain any files
25- # or directories other than what the oops machinery creates there.
26- #
27- # directory:
28- directory: "logs/oops"
29- # reporter:
30- reporter: "maas-pserv"
31-
32 ## TFTP configuration.
33 #
34 tftp:
35
36=== modified file 'required-packages/base'
37--- required-packages/base 2014-09-24 13:05:22 +0000
38+++ required-packages/base 2015-03-02 14:13:04 +0000
39@@ -12,6 +12,7 @@
40 libpq-dev
41 postgresql
42 python-amqplib
43+python-bson
44 python-bzrlib
45 python-celery
46 python-convoy
47@@ -32,11 +33,6 @@
48 python-netaddr
49 python-netifaces
50 python-oauth
51-python-oops
52-python-oops-amqp
53-python-oops-datedir-repo
54-python-oops-twisted
55-python-oops-wsgi
56 python-openssl
57 python-paramiko
58 python-pexpect
59
60=== modified file 'setup.py'
61--- setup.py 2014-09-29 15:26:08 +0000
62+++ setup.py 2015-03-02 14:13:04 +0000
63@@ -125,9 +125,6 @@
64 'django-piston',
65 'FormEncode',
66 'oauth',
67- 'oops',
68- 'oops-datedir-repo',
69- 'oops-twisted',
70 'PyYAML',
71 'South',
72 'Twisted',
73
74=== modified file 'src/maas/settings.py'
75--- src/maas/settings.py 2014-12-02 15:55:34 +0000
76+++ src/maas/settings.py 2015-03-02 14:13:04 +0000
77@@ -47,9 +47,6 @@
78
79 MANAGERS = ADMINS
80
81-# Location where python-oops should store errors.
82-OOPS_REPOSITORY = 'logs/oops'
83-
84 LOGOUT_URL = '/'
85 LOGIN_REDIRECT_URL = '/'
86 LOGIN_URL = '/accounts/login/'
87
88=== modified file 'src/maasserver/management/commands/runserver.py'
89--- src/maasserver/management/commands/runserver.py 2013-10-18 16:57:37 +0000
90+++ src/maasserver/management/commands/runserver.py 2015-03-02 14:13:04 +0000
91@@ -17,39 +17,10 @@
92 from optparse import make_option
93 from SocketServer import ThreadingMixIn
94
95-from django.conf import settings
96 from django.core.management.commands.runserver import BaseRunserverCommand
97 from django.core.servers import basehttp
98 from django.core.servers.basehttp import WSGIServer
99 from maasserver.start_up import start_up
100-import oops
101-from oops_datedir_repo import DateDirRepo
102-from oops_wsgi import (
103- install_hooks,
104- make_app,
105- )
106-
107-
108-error_template = """
109-<html>
110-<head><title>Oops! - %(id)s</title></head>
111-<body>
112-<h1>Oops!</h1>
113-<p>
114- Something broke while generating this page.
115-</p>
116-<p>
117- If the problem persists, please
118- <a href="https://bugs.launchpad.net/maas/">file a bug</a>. Make a note of
119- the "oops id": <strong>%(id)s</strong>
120-</p>
121-</html>
122-""".lstrip()
123-
124-
125-def render_error(report):
126- """Produce an HTML error report, in raw bytes (not unicode)."""
127- return (error_template % report).encode('ascii')
128
129
130 class Command(BaseRunserverCommand):
131@@ -73,19 +44,3 @@
132
133 start_up()
134 return super(Command, self).run(*args, **options)
135-
136- def get_handler(self, *args, **kwargs):
137- """Overridable from `BaseRunserverCommand`: Obtain a WSGI handler."""
138- wsgi_handler = super(Command, self).get_handler(self, *args, **kwargs)
139-
140- # Wrap the WSGI handler in an oops handler. This catches (most)
141- # exceptions bubbling up out of the app, and stores them as
142- # oopses in the directory specified by the OOPS_REPOSITORY
143- # configuration setting.
144- # Django's debug mode causes it to handle exceptions itself, so
145- # don't expect oopses when DEBUG is set to True.
146- oops_config = oops.Config()
147- oops_repository = DateDirRepo(settings.OOPS_REPOSITORY)
148- oops_config.publishers.append(oops_repository.publish)
149- install_hooks(oops_config)
150- return make_app(wsgi_handler, oops_config, error_render=render_error)
151
152=== removed file 'src/maasserver/tests/test_runserver.py'
153--- src/maasserver/tests/test_runserver.py 2013-10-07 09:12:40 +0000
154+++ src/maasserver/tests/test_runserver.py 1970-01-01 00:00:00 +0000
155@@ -1,38 +0,0 @@
156-# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
157-# GNU Affero General Public License version 3 (see the file LICENSE).
158-
159-"""Tests for the "runserver" command module."""
160-
161-from __future__ import (
162- absolute_import,
163- print_function,
164- unicode_literals,
165- )
166-
167-str = None
168-
169-__metaclass__ = type
170-__all__ = []
171-
172-from maasserver.management.commands.runserver import render_error
173-from maasserver.testing.testcase import MAASServerTestCase
174-
175-
176-class TestRunServer(MAASServerTestCase):
177-
178- def test_render_error_mentions_oops_id(self):
179- fake_oops = {'id': 'EHOVERCRAFTFULL999'}
180- self.assertIn(fake_oops['id'], render_error(fake_oops))
181-
182- def test_render_error_returns_bytes(self):
183- # wsgi_oops produces oops pages as unicode strings, but django
184- # expects raw bytes. Our own error renderer returns bytes.
185- fake_oops = {'id': 'abc123'}
186- self.assertIsInstance(render_error(fake_oops), bytes)
187-
188- def test_render_error_blows_up_if_oops_id_is_not_ascii(self):
189- # Oopses mean that things aren't working as they should. We
190- # won't make things worse by including non-ASCII characters in
191- # the oops page.
192- fake_oops = {'id': '\u2322'}
193- self.assertRaises(Exception, render_error, fake_oops)
194
195=== modified file 'src/provisioningserver/config.py'
196--- src/provisioningserver/config.py 2014-09-23 20:20:16 +0000
197+++ src/provisioningserver/config.py 2015-03-02 14:13:04 +0000
198@@ -87,7 +87,12 @@
199
200
201 class ConfigOops(Schema):
202- """Configuration validator for OOPS options."""
203+ """Configuration validator for OOPS options.
204+
205+ Deprecated: MAAS no longer records OOPS reports. This remains here to
206+ avoid validation failures when using old versions of the cluster's
207+ configuration file.
208+ """
209
210 if_key_missing = None
211
212
213=== modified file 'src/provisioningserver/plugin.py'
214--- src/provisioningserver/plugin.py 2014-10-03 22:46:34 +0000
215+++ src/provisioningserver/plugin.py 2015-03-02 14:13:04 +0000
216@@ -14,20 +14,12 @@
217 __metaclass__ = type
218 __all__ = [
219 "LogService",
220- "OOPSService",
221 "ProvisioningServiceMaker",
222 ]
223
224 import signal
225 import sys
226
227-import oops
228-from oops_datedir_repo import DateDirRepo
229-from oops_twisted import (
230- Config as oops_config,
231- defer_publisher,
232- OOPSObserver,
233- )
234 import provisioningserver
235 from provisioningserver.cluster_config import get_cluster_uuid
236 from provisioningserver.config import Config
237@@ -61,11 +53,7 @@
238 )
239 from twisted.plugin import IPlugin
240 from twisted.python import usage
241-from twisted.python.log import (
242- addObserver,
243- FileLogObserver,
244- removeObserver,
245- )
246+from twisted.python.log import FileLogObserver
247 from twisted.python.logfile import LogFile
248 from twisted.web.resource import (
249 IResource,
250@@ -153,38 +141,6 @@
251 self.logfile = None
252
253
254-class OOPSService(Service):
255-
256- name = "oops"
257-
258- def __init__(self, log_service, oops_dir, oops_reporter):
259- self.config = None
260- self.log_service = log_service
261- self.oops_dir = oops_dir
262- self.oops_reporter = oops_reporter
263-
264- def startService(self):
265- Service.startService(self)
266- self.config = oops_config()
267- # Add the oops publisher that writes files in the configured place if
268- # the command line option was set.
269- if self.oops_dir:
270- repo = DateDirRepo(self.oops_dir)
271- self.config.publishers.append(
272- defer_publisher(oops.publish_new_only(repo.publish)))
273- if self.oops_reporter:
274- self.config.template['reporter'] = self.oops_reporter
275- self.observer = OOPSObserver(
276- self.config, self.log_service.observer.emit)
277- addObserver(self.observer.emit)
278-
279- def stopService(self):
280- Service.stopService(self)
281- removeObserver(self.observer.emit)
282- self.observer = None
283- self.config = None
284-
285-
286 class Options(usage.Options):
287 """Command line options for the provisioning server."""
288
289@@ -207,12 +163,6 @@
290 """Create the log service."""
291 return LogService(config["logfile"])
292
293- def _makeOopsService(self, log_service, oops_config):
294- """Create the oops service."""
295- oops_dir = oops_config["directory"]
296- oops_reporter = oops_config["reporter"]
297- return OOPSService(log_service, oops_dir, oops_reporter)
298-
299 def _makeSiteService(self, papi_xmlrpc, config):
300 """Create the site service."""
301 site_root = Resource()
302@@ -268,9 +218,6 @@
303 log_service = self._makeLogService(config)
304 log_service.setServiceParent(services)
305
306- oops_service = self._makeOopsService(log_service, config["oops"])
307- oops_service.setServiceParent(services)
308-
309 tftp_service = self._makeTFTPService(config["tftp"])
310 tftp_service.setServiceParent(services)
311
312
313=== modified file 'src/provisioningserver/tests/test_config.py'
314--- src/provisioningserver/tests/test_config.py 2014-08-20 19:04:17 +0000
315+++ src/provisioningserver/tests/test_config.py 2015-03-02 14:13:04 +0000
316@@ -367,8 +367,6 @@
317
318 default_development_config = deepcopy(default_production_config)
319 default_development_config.update(logfile="/dev/null")
320- default_development_config["oops"].update(
321- directory="logs/oops", reporter="maas-pserv")
322 default_development_config["tftp"].update(
323 port=5244, generator="http://localhost:5243/api/1.0/pxeconfig/")
324
325
326=== modified file 'src/provisioningserver/tests/test_plugin.py'
327--- src/provisioningserver/tests/test_plugin.py 2014-10-02 11:53:59 +0000
328+++ src/provisioningserver/tests/test_plugin.py 2015-03-02 14:13:04 +0000
329@@ -118,7 +118,7 @@
330 self.assertIsInstance(service, MultiService)
331 expected_services = [
332 "dhcp_probe", "image_download", "lease_upload", "log",
333- "node_monitor", "oops", "rpc", "tftp",
334+ "node_monitor", "rpc", "tftp",
335 ]
336 self.assertItemsEqual(expected_services, service.namedServices)
337 self.assertEqual(
338
339=== modified file 'src/provisioningserver/tests/test_plugin_services.py'
340--- src/provisioningserver/tests/test_plugin_services.py 2014-09-01 08:40:13 +0000
341+++ src/provisioningserver/tests/test_plugin_services.py 2015-03-02 14:13:04 +0000
342@@ -14,20 +14,14 @@
343 __metaclass__ = type
344 __all__ = []
345
346-import os
347 import signal
348 import sys
349
350-from maastesting.factory import factory
351 from maastesting.testcase import (
352 MAASTestCase,
353 MAASTwistedRunTest,
354 )
355-from oops_twisted import OOPSObserver
356-from provisioningserver.plugin import (
357- LogService,
358- OOPSService,
359- )
360+from provisioningserver.plugin import LogService
361 from testtools.content import content_from_file
362 from twisted.application.service import MultiService
363 from twisted.python.log import (
364@@ -91,33 +85,3 @@
365 self.assertEqual(
366 signal.getsignal(signal.SIGUSR1),
367 log_service._signal_handler)
368-
369-
370-class TestOOPSService(TestServicesBase, MAASTestCase):
371- """Tests for `provisioningserver.services.OOPSService`."""
372-
373- def setUp(self):
374- super(TestOOPSService, self).setUp()
375- # OOPSService relies upon LogService.
376- self.tempdir = self.make_dir()
377- self.log_filename = factory.make_file(
378- location=self.tempdir, name="test.log")
379- self.log_service = LogService(self.log_filename)
380- self.log_service.setServiceParent(self.services)
381-
382- def test_minimal(self):
383- oops_service = OOPSService(self.log_service, None, None)
384- oops_service.setServiceParent(self.services)
385- observer = oops_service.observer
386- self.assertIsInstance(observer, OOPSObserver)
387- self.assertEqual([], observer.config.publishers)
388- self.assertEqual({}, observer.config.template)
389-
390- def test_with_all_params(self):
391- oops_dir = os.path.join(self.tempdir, "oops")
392- oops_service = OOPSService(self.log_service, oops_dir, "Sidebottom")
393- oops_service.setServiceParent(self.services)
394- observer = oops_service.observer
395- self.assertIsInstance(observer, OOPSObserver)
396- self.assertEqual(1, len(observer.config.publishers))
397- self.assertEqual({"reporter": "Sidebottom"}, observer.config.template)

Subscribers

People subscribed via source and target branches

to all changes: