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

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 3457
Proposed branch: lp:~allenap/maas/oops-did-it-again
Merge into: lp:~maas-committers/maas/trunk
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
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+246463@code.launchpad.net

Commit message

Remove all OOPS reporting.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

I am very happy to review this!

Glad its gone!

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

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

Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:2 http://security.ubuntu.com trusty-security Release [62.0 kB]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [61.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:6 http://security.ubuntu.com trusty-security/universe Sources [17.4 kB]
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [193 kB]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [83.9 kB]
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://security.ubuntu.com trusty-security/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [154 kB]
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [96.5 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [398 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [238 kB]
Get:13 http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en [188 kB]
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,556 kB in 3s (509 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-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 p...

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

Unrelated failure :-/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/development/cluster-bootstrap.rst'
--- docs/development/cluster-bootstrap.rst 2014-10-09 21:53:36 +0000
+++ docs/development/cluster-bootstrap.rst 2015-01-14 16:31:22 +0000
@@ -29,7 +29,7 @@
2929
30#. ``ClusterClientService`` starts.30#. ``ClusterClientService`` starts.
3131
32#. Services other than log and oops are **not** started.32#. Services other than ``log`` are **not** started.
3333
34#. Wait for a connection to the region to become available.34#. Wait for a connection to the region to become available.
3535
3636
=== modified file 'etc/maas/pserv.yaml'
--- etc/maas/pserv.yaml 2014-08-13 21:49:35 +0000
+++ etc/maas/pserv.yaml 2015-01-14 16:31:22 +0000
@@ -8,17 +8,6 @@
8# logfile: "pserv.log"8# logfile: "pserv.log"
9logfile: "/dev/null"9logfile: "/dev/null"
1010
11## OOPS configuration (optional).
12#
13oops:
14 ## Directory in which to place OOPS reports. Must not contain any files
15 # or directories other than what the oops machinery creates there.
16 #
17 # directory:
18 directory: "logs/oops"
19 # reporter:
20 reporter: "maas-pserv"
21
22## TFTP configuration.11## TFTP configuration.
23#12#
24tftp:13tftp:
2514
=== modified file 'required-packages/base'
--- required-packages/base 2014-11-14 17:44:54 +0000
+++ required-packages/base 2015-01-14 16:31:22 +0000
@@ -12,6 +12,7 @@
12libpq-dev12libpq-dev
13postgresql13postgresql
14python-amqplib14python-amqplib
15python-bson
15python-bzrlib16python-bzrlib
16python-convoy17python-convoy
17python-crochet18python-crochet
@@ -31,11 +32,6 @@
31python-netaddr32python-netaddr
32python-netifaces33python-netifaces
33python-oauth34python-oauth
34python-oops
35python-oops-amqp
36python-oops-datedir-repo
37python-oops-twisted
38python-oops-wsgi
39python-openssl35python-openssl
40python-paramiko36python-paramiko
41python-pexpect37python-pexpect
4238
=== modified file 'setup.py'
--- setup.py 2014-09-29 15:26:08 +0000
+++ setup.py 2015-01-14 16:31:22 +0000
@@ -125,9 +125,6 @@
125 'django-piston',125 'django-piston',
126 'FormEncode',126 'FormEncode',
127 'oauth',127 'oauth',
128 'oops',
129 'oops-datedir-repo',
130 'oops-twisted',
131 'PyYAML',128 'PyYAML',
132 'South',129 'South',
133 'Twisted',130 'Twisted',
134131
=== modified file 'src/maas/settings.py'
--- src/maas/settings.py 2014-12-05 12:48:49 +0000
+++ src/maas/settings.py 2015-01-14 16:31:22 +0000
@@ -47,9 +47,6 @@
4747
48MANAGERS = ADMINS48MANAGERS = ADMINS
4949
50# Location where python-oops should store errors.
51OOPS_REPOSITORY = 'logs/oops'
52
53LOGOUT_URL = '/'50LOGOUT_URL = '/'
54LOGIN_REDIRECT_URL = '/'51LOGIN_REDIRECT_URL = '/'
55LOGIN_URL = '/accounts/login/'52LOGIN_URL = '/accounts/login/'
5653
=== modified file 'src/maasserver/management/commands/runserver.py'
--- src/maasserver/management/commands/runserver.py 2013-10-18 16:57:37 +0000
+++ src/maasserver/management/commands/runserver.py 2015-01-14 16:31:22 +0000
@@ -17,39 +17,10 @@
17from optparse import make_option17from optparse import make_option
18from SocketServer import ThreadingMixIn18from SocketServer import ThreadingMixIn
1919
20from django.conf import settings
21from django.core.management.commands.runserver import BaseRunserverCommand20from django.core.management.commands.runserver import BaseRunserverCommand
22from django.core.servers import basehttp21from django.core.servers import basehttp
23from django.core.servers.basehttp import WSGIServer22from django.core.servers.basehttp import WSGIServer
24from maasserver.start_up import start_up23from maasserver.start_up import start_up
25import oops
26from oops_datedir_repo import DateDirRepo
27from oops_wsgi import (
28 install_hooks,
29 make_app,
30 )
31
32
33error_template = """
34<html>
35<head><title>Oops! - %(id)s</title></head>
36<body>
37<h1>Oops!</h1>
38<p>
39 Something broke while generating this page.
40</p>
41<p>
42 If the problem persists, please
43 <a href="https://bugs.launchpad.net/maas/">file a bug</a>. Make a note of
44 the "oops id": <strong>%(id)s</strong>
45</p>
46</html>
47""".lstrip()
48
49
50def render_error(report):
51 """Produce an HTML error report, in raw bytes (not unicode)."""
52 return (error_template % report).encode('ascii')
5324
5425
55class Command(BaseRunserverCommand):26class Command(BaseRunserverCommand):
@@ -73,19 +44,3 @@
7344
74 start_up()45 start_up()
75 return super(Command, self).run(*args, **options)46 return super(Command, self).run(*args, **options)
76
77 def get_handler(self, *args, **kwargs):
78 """Overridable from `BaseRunserverCommand`: Obtain a WSGI handler."""
79 wsgi_handler = super(Command, self).get_handler(self, *args, **kwargs)
80
81 # Wrap the WSGI handler in an oops handler. This catches (most)
82 # exceptions bubbling up out of the app, and stores them as
83 # oopses in the directory specified by the OOPS_REPOSITORY
84 # configuration setting.
85 # Django's debug mode causes it to handle exceptions itself, so
86 # don't expect oopses when DEBUG is set to True.
87 oops_config = oops.Config()
88 oops_repository = DateDirRepo(settings.OOPS_REPOSITORY)
89 oops_config.publishers.append(oops_repository.publish)
90 install_hooks(oops_config)
91 return make_app(wsgi_handler, oops_config, error_render=render_error)
9247
=== removed file 'src/maasserver/tests/test_runserver.py'
--- src/maasserver/tests/test_runserver.py 2013-10-07 09:12:40 +0000
+++ src/maasserver/tests/test_runserver.py 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for the "runserver" command module."""
5
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12str = None
13
14__metaclass__ = type
15__all__ = []
16
17from maasserver.management.commands.runserver import render_error
18from maasserver.testing.testcase import MAASServerTestCase
19
20
21class TestRunServer(MAASServerTestCase):
22
23 def test_render_error_mentions_oops_id(self):
24 fake_oops = {'id': 'EHOVERCRAFTFULL999'}
25 self.assertIn(fake_oops['id'], render_error(fake_oops))
26
27 def test_render_error_returns_bytes(self):
28 # wsgi_oops produces oops pages as unicode strings, but django
29 # expects raw bytes. Our own error renderer returns bytes.
30 fake_oops = {'id': 'abc123'}
31 self.assertIsInstance(render_error(fake_oops), bytes)
32
33 def test_render_error_blows_up_if_oops_id_is_not_ascii(self):
34 # Oopses mean that things aren't working as they should. We
35 # won't make things worse by including non-ASCII characters in
36 # the oops page.
37 fake_oops = {'id': '\u2322'}
38 self.assertRaises(Exception, render_error, fake_oops)
390
=== modified file 'src/provisioningserver/config.py'
--- src/provisioningserver/config.py 2014-09-23 20:20:16 +0000
+++ src/provisioningserver/config.py 2015-01-14 16:31:22 +0000
@@ -87,7 +87,12 @@
8787
8888
89class ConfigOops(Schema):89class ConfigOops(Schema):
90 """Configuration validator for OOPS options."""90 """Configuration validator for OOPS options.
91
92 Deprecated: MAAS no longer records OOPS reports. This remains here to
93 avoid validation failures when using old versions of the cluster's
94 configuration file.
95 """
9196
92 if_key_missing = None97 if_key_missing = None
9398
9499
=== modified file 'src/provisioningserver/plugin.py'
--- src/provisioningserver/plugin.py 2014-10-03 22:46:34 +0000
+++ src/provisioningserver/plugin.py 2015-01-14 16:31:22 +0000
@@ -14,20 +14,12 @@
14__metaclass__ = type14__metaclass__ = type
15__all__ = [15__all__ = [
16 "LogService",16 "LogService",
17 "OOPSService",
18 "ProvisioningServiceMaker",17 "ProvisioningServiceMaker",
19]18]
2019
21import signal20import signal
22import sys21import sys
2322
24import oops
25from oops_datedir_repo import DateDirRepo
26from oops_twisted import (
27 Config as oops_config,
28 defer_publisher,
29 OOPSObserver,
30 )
31import provisioningserver23import provisioningserver
32from provisioningserver.cluster_config import get_cluster_uuid24from provisioningserver.cluster_config import get_cluster_uuid
33from provisioningserver.config import Config25from provisioningserver.config import Config
@@ -61,11 +53,7 @@
61 )53 )
62from twisted.plugin import IPlugin54from twisted.plugin import IPlugin
63from twisted.python import usage55from twisted.python import usage
64from twisted.python.log import (56from twisted.python.log import FileLogObserver
65 addObserver,
66 FileLogObserver,
67 removeObserver,
68 )
69from twisted.python.logfile import LogFile57from twisted.python.logfile import LogFile
70from twisted.web.resource import (58from twisted.web.resource import (
71 IResource,59 IResource,
@@ -153,38 +141,6 @@
153 self.logfile = None141 self.logfile = None
154142
155143
156class OOPSService(Service):
157
158 name = "oops"
159
160 def __init__(self, log_service, oops_dir, oops_reporter):
161 self.config = None
162 self.log_service = log_service
163 self.oops_dir = oops_dir
164 self.oops_reporter = oops_reporter
165
166 def startService(self):
167 Service.startService(self)
168 self.config = oops_config()
169 # Add the oops publisher that writes files in the configured place if
170 # the command line option was set.
171 if self.oops_dir:
172 repo = DateDirRepo(self.oops_dir)
173 self.config.publishers.append(
174 defer_publisher(oops.publish_new_only(repo.publish)))
175 if self.oops_reporter:
176 self.config.template['reporter'] = self.oops_reporter
177 self.observer = OOPSObserver(
178 self.config, self.log_service.observer.emit)
179 addObserver(self.observer.emit)
180
181 def stopService(self):
182 Service.stopService(self)
183 removeObserver(self.observer.emit)
184 self.observer = None
185 self.config = None
186
187
188class Options(usage.Options):144class Options(usage.Options):
189 """Command line options for the provisioning server."""145 """Command line options for the provisioning server."""
190146
@@ -207,12 +163,6 @@
207 """Create the log service."""163 """Create the log service."""
208 return LogService(config["logfile"])164 return LogService(config["logfile"])
209165
210 def _makeOopsService(self, log_service, oops_config):
211 """Create the oops service."""
212 oops_dir = oops_config["directory"]
213 oops_reporter = oops_config["reporter"]
214 return OOPSService(log_service, oops_dir, oops_reporter)
215
216 def _makeSiteService(self, papi_xmlrpc, config):166 def _makeSiteService(self, papi_xmlrpc, config):
217 """Create the site service."""167 """Create the site service."""
218 site_root = Resource()168 site_root = Resource()
@@ -268,9 +218,6 @@
268 log_service = self._makeLogService(config)218 log_service = self._makeLogService(config)
269 log_service.setServiceParent(services)219 log_service.setServiceParent(services)
270220
271 oops_service = self._makeOopsService(log_service, config["oops"])
272 oops_service.setServiceParent(services)
273
274 tftp_service = self._makeTFTPService(config["tftp"])221 tftp_service = self._makeTFTPService(config["tftp"])
275 tftp_service.setServiceParent(services)222 tftp_service.setServiceParent(services)
276223
277224
=== modified file 'src/provisioningserver/tests/test_config.py'
--- src/provisioningserver/tests/test_config.py 2014-08-20 19:04:17 +0000
+++ src/provisioningserver/tests/test_config.py 2015-01-14 16:31:22 +0000
@@ -367,8 +367,6 @@
367367
368 default_development_config = deepcopy(default_production_config)368 default_development_config = deepcopy(default_production_config)
369 default_development_config.update(logfile="/dev/null")369 default_development_config.update(logfile="/dev/null")
370 default_development_config["oops"].update(
371 directory="logs/oops", reporter="maas-pserv")
372 default_development_config["tftp"].update(370 default_development_config["tftp"].update(
373 port=5244, generator="http://localhost:5243/api/1.0/pxeconfig/")371 port=5244, generator="http://localhost:5243/api/1.0/pxeconfig/")
374372
375373
=== modified file 'src/provisioningserver/tests/test_plugin.py'
--- src/provisioningserver/tests/test_plugin.py 2014-10-02 11:53:59 +0000
+++ src/provisioningserver/tests/test_plugin.py 2015-01-14 16:31:22 +0000
@@ -118,7 +118,7 @@
118 self.assertIsInstance(service, MultiService)118 self.assertIsInstance(service, MultiService)
119 expected_services = [119 expected_services = [
120 "dhcp_probe", "image_download", "lease_upload", "log",120 "dhcp_probe", "image_download", "lease_upload", "log",
121 "node_monitor", "oops", "rpc", "tftp",121 "node_monitor", "rpc", "tftp",
122 ]122 ]
123 self.assertItemsEqual(expected_services, service.namedServices)123 self.assertItemsEqual(expected_services, service.namedServices)
124 self.assertEqual(124 self.assertEqual(
125125
=== modified file 'src/provisioningserver/tests/test_plugin_services.py'
--- src/provisioningserver/tests/test_plugin_services.py 2014-09-01 08:40:13 +0000
+++ src/provisioningserver/tests/test_plugin_services.py 2015-01-14 16:31:22 +0000
@@ -14,20 +14,14 @@
14__metaclass__ = type14__metaclass__ = type
15__all__ = []15__all__ = []
1616
17import os
18import signal17import signal
19import sys18import sys
2019
21from maastesting.factory import factory
22from maastesting.testcase import (20from maastesting.testcase import (
23 MAASTestCase,21 MAASTestCase,
24 MAASTwistedRunTest,22 MAASTwistedRunTest,
25 )23 )
26from oops_twisted import OOPSObserver24from provisioningserver.plugin import LogService
27from provisioningserver.plugin import (
28 LogService,
29 OOPSService,
30 )
31from testtools.content import content_from_file25from testtools.content import content_from_file
32from twisted.application.service import MultiService26from twisted.application.service import MultiService
33from twisted.python.log import (27from twisted.python.log import (
@@ -91,33 +85,3 @@
91 self.assertEqual(85 self.assertEqual(
92 signal.getsignal(signal.SIGUSR1),86 signal.getsignal(signal.SIGUSR1),
93 log_service._signal_handler)87 log_service._signal_handler)
94
95
96class TestOOPSService(TestServicesBase, MAASTestCase):
97 """Tests for `provisioningserver.services.OOPSService`."""
98
99 def setUp(self):
100 super(TestOOPSService, self).setUp()
101 # OOPSService relies upon LogService.
102 self.tempdir = self.make_dir()
103 self.log_filename = factory.make_file(
104 location=self.tempdir, name="test.log")
105 self.log_service = LogService(self.log_filename)
106 self.log_service.setServiceParent(self.services)
107
108 def test_minimal(self):
109 oops_service = OOPSService(self.log_service, None, None)
110 oops_service.setServiceParent(self.services)
111 observer = oops_service.observer
112 self.assertIsInstance(observer, OOPSObserver)
113 self.assertEqual([], observer.config.publishers)
114 self.assertEqual({}, observer.config.template)
115
116 def test_with_all_params(self):
117 oops_dir = os.path.join(self.tempdir, "oops")
118 oops_service = OOPSService(self.log_service, oops_dir, "Sidebottom")
119 oops_service.setServiceParent(self.services)
120 observer = oops_service.observer
121 self.assertIsInstance(observer, OOPSObserver)
122 self.assertEqual(1, len(observer.config.publishers))
123 self.assertEqual({"reporter": "Sidebottom"}, observer.config.template)