Merge lp:~jtv/maas/oops into lp:maas/trunk
| Status: | Merged |
|---|---|
| Approved by: | Julian Edwards on 2012-01-19 |
| Approved revision: | 29 |
| Merged at revision: | 28 |
| Proposed branch: | lp:~jtv/maas/oops |
| Merge into: | lp:maas/trunk |
| Diff against target: |
157 lines (+82/-3) 7 files modified
buildout.cfg (+3/-0) src/maas/development.py (+3/-0) src/maas/production.py (+3/-0) src/maas/settings.py (+3/-0) src/maasserver/management/commands/deletedb.py (+15/-1) src/maasserver/management/commands/query.py (+16/-2) src/maasserver/management/commands/runserver.py (+39/-0) |
| To merge this branch: | bzr merge lp:~jtv/maas/oops |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Julian Edwards (community) | Approve on 2012-01-19 | ||
| Gavin Panella (community) | 2012-01-19 | Approve on 2012-01-19 | |
|
Review via email:
|
|||
Commit Message
Basic oops integration.
Description of the Change
Basic oops integration.
This enables basic oops logging for MaaS: if django raises an exception while handling a request, log it as an oops. By default, production oopses go into /var/log/
Don't expect to see familiar Launchpad-style oops pages just yet. Two things are still missing:
* In debug mode, django catches exceptions and displays its own error page, with essentially the same information. Which is probably fine, but the error doesn't bubble up out of django and so no oops is stored.
* There's no display support for oopses. You may want to install and use python-oops-tools yourself to work with the oops files.
Jeroen
| Julian Edwards (julian-edwards) wrote : | # |
+ oops_config = Config()
I think this would scan better if you did:
import oops
oops_config = oops.Config()
because I was left wondering what Config() was a config for....
Otherwise Gavin's comments capture everything I would have said, and more :)
- 30. By Jeroen T. Vermeulen on 2012-01-19
-
Review changes.
| Jeroen T. Vermeulen (jtv) wrote : | # |
> === modified file 'src/maas/
> --- src/maas/
> +++ src/maas/
> @@ -20,6 +20,9 @@
>
> MANAGERS = ADMINS
>
> +# Location where python-oops should store errors.
> +OOPS_REPOSITORY = '/var/log/maas'
> +
>
> Would it be worth setting this in production.py and using something
> like "/does/not/exist" in settings.py?
Not very nice; at any rate the directory gets created. I did add it to production.py, and made the default local. I considered None, but that would just produce an obscure error on top of an app failure.
> === added file 'src/maasserver
>
> What happens if we get another app in this Django project? Does Django
> correctly execute the runserver command for each application in in the
> project, or will this break?
I think that, assuming we wanted the same oops-tools setup, we'd want to move common code out to a shared location somewhere and give that app its own runserver.py.
Not something I'm worried about right now though.
> Can you use the template from templates/module.py and run
> utilities/
Done. Also for the other command modules.
> [4]
>
> + wsgi_handler = BaseRunserverCo
> **kwargs)
>
> Use super()?
I worried about super() being too clever for this use-case and surprising me in some way, but okay, I'll give it a whirl.
Jeroen
- 31. By Jeroen T. Vermeulen on 2012-01-19
-
Review change: super().
- 32. By Jeroen T. Vermeulen on 2012-01-19
-
Review change.


Looks great :)
[1]
=== modified file 'src/maas/ settings. py' settings. py 2012-01-19 13:56:36 +0000 settings. py 2012-01-19 15:28:18 +0000
--- src/maas/
+++ src/maas/
@@ -20,6 +20,9 @@
MANAGERS = ADMINS
+# Location where python-oops should store errors.
+OOPS_REPOSITORY = '/var/log/maas'
+
Would it be worth setting this in production.py and using something
like "/does/not/exist" in settings.py?
[2]
=== added file 'src/maasserver /management/ commands/ runserver. py'
What happens if we get another app in this Django project? Does Django
correctly execute the runserver command for each application in in the
project, or will this break?
[3]
Can you use the template from templates/module.py and run format- new-and- modified- imports?
utilities/
[4]
+ wsgi_handler = BaseRunserverCo mmand.get_ handler( self, *args, **kwargs)
Use super()?