~ubuntu-branches/ubuntu/precise/maas/precise-security

« back to all changes in this revision

Viewing changes to src/maasserver/middleware.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Dave Walker (Daviey), Andres Rodriguez
  • Date: 2012-03-27 14:49:56 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120327144956-zezstgry6t61438x
Tags: 0.1+bzr363+dfsg-0ubuntu1
[ Dave Walker (Daviey) ]
* debian/control: Add openssh-server as a Recommends, and wrap-and-sort. 

[ Andres Rodriguez ]
* debian/maas.postinst:
  - Do not start apache with apache2ctl. Use invoke-rc.d instead to not
    fail in the installer.
  - For start of postgresql before creating the DB, otherwise it will
    fail in the installer.
  - Add check of invoke-rc.d for syslog.
  - Add check of invoke-rc.d for rabbitmq-server; Add check for rabbitmqctl
  - Add db_stop, in case invoke-rc.d fails.
* debian/control: Tight python-django-maas dependency.
* debian/postrm: Add check for rabbitmqctl.
* debian/maas.maas-txlongpoll.upstart: Create rabbitmq longpoll user/vhost
  and set permissions if they don't exist. Start on rabbitmq-server-running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    ABCMeta,
20
20
    abstractproperty,
21
21
    )
 
22
import httplib
22
23
import json
23
24
import logging
24
25
import re
73
74
            reverse('metadata'),
74
75
            # API calls are protected by piston.
75
76
            settings.API_URL_REGEXP,
76
 
            r'^/accounts/[\w]+/sshkeys/$',
77
77
            ]
78
78
        self.public_urls = re.compile("|".join(public_url_roots))
79
79
        self.login_url = reverse('login')
142
142
                    unicode(''.join(exception.messages)).encode(encoding),
143
143
                    mimetype=b"text/plain; charset=%s" % encoding)
144
144
        else:
145
 
            # Do not handle the exception, this will result in a
146
 
            # "Internal Server Error" response.
147
 
            return None
 
145
            # Return an API-readable "Internal Server Error" response.
 
146
            return HttpResponse(
 
147
                content=unicode(exception).encode(encoding),
 
148
                status=httplib.INTERNAL_SERVER_ERROR,
 
149
                mimetype=b"text/plain; charset=%s" % encoding)
148
150
 
149
151
 
150
152
class APIErrorsMiddleware(ExceptionMiddleware):