Repository: fedora-infra/bodhi

Issue:
Bodhi is not compatible with Cornice 3.2.0
I noticed today that the Vagrant environment will not serve Bodhi:

```
Traceback (most recent call last):
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 267, in _bootstrap
    self.run()
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python2.7/site-packages/hupper/worker.py", line 253, in worker_main
    func(*spec_args, **spec_kwargs)
  File "/usr/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 32, in main
    return command.run()
  File "/usr/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 229, in run
    app = loader.get_wsgi_app(app_name, config_vars)
  File "/usr/lib/python2.7/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
    global_conf=defaults)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/home/vagrant/bodhi/bodhi/server/__init__.py", line 358, in main
    return config.make_wsgi_app()
  File "/usr/lib/python2.7/site-packages/pyramid/config/__init__.py", line 1052, in make_wsgi_app
    self.commit()
  File "/usr/lib/python2.7/site-packages/pyramid/config/__init__.py", line 684, in commit
    self.action_state.execute_actions(introspector=self.introspector)
  File "/usr/lib/python2.7/site-packages/pyramid/config/__init__.py", line 1197, in execute_actions
    action = next(action_iter, None)
  File "/usr/lib/python2.7/site-packages/pyramid/config/__init__.py", line 1379, in resolveConflicts
    raise ConfigurationConflictError(conflicts)
ConfigurationConflictError: Conflicting configuration actions
  For: ('view', <class 'pyramid.httpexceptions.HTTPForbidden'>, '', None, 'd41d8cd98f00b204e9800998ecf8427e')
    Line 343 of file /home/vagrant/bodhi/bodhi/server/__init__.py:
        config.add_view('bodhi.server.security.login', context=HTTPForbidden)
    Line 430 of file /home/vagrant/bodhi/bodhi/server/views/generic.py:
        @view_config(context=Exception)
```

After some debugging, I found that downgrading the Vagrant environment to Cornice 3.1.0 gets it working again. The cornice [changelog](https://github.com/Cornices/cornice/blob/3.2.0/CHANGES.txt) doesn't have anything that sounds like a backwards incompatible change, but @puiterwijk noticed a [commit](https://github.com/Cornices/cornice/pull/477) that might be relevant.


Discussion:
Hi everyone, in the referenced issue I've left information why things are not working correctly anymore. Sorry for the inconvenience this caused but the real problem was being hidden from you all the time, it was always there, just the exception was not being thrown.
Thanks @ergo!

Resolving patch:
diff --git a/bodhi/server/__init__.py b/bodhi/server/__init__.py
--- a/bodhi/server/__init__.py
+++ b/bodhi/server/__init__.py
@@ -26,7 +26,6 @@
 from pyramid.authentication import AuthTktAuthenticationPolicy
 from pyramid.authorization import ACLAuthorizationPolicy
 from pyramid.config import Configurator
-from pyramid.exceptions import HTTPForbidden
 from pyramid.renderers import JSONP
 from sqlalchemy import engine_from_config, event
 from sqlalchemy.orm import scoped_session, sessionmaker
@@ -305,7 +304,6 @@ def main(global_config, testing=None, session=None, **settings):
     # pyramid.openid
     config.add_route('login', '/login')
     config.add_view('bodhi.server.security.login', route_name='login')
-    config.add_view('bodhi.server.security.login', context=HTTPForbidden)
     config.add_route('logout', '/logout')
     config.add_view('bodhi.server.security.logout', route_name='logout')
     config.add_route('verify_openid', pattern='/dologin.html')


Test patch: