From: Kefu Chai Date: Tue, 13 Jun 2017 02:37:49 +0000 (+0800) Subject: pybind/mgr/restful: use list to pass hooks to create a `Pecan` instance X-Git-Tag: v12.1.0~139^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f007d935c57b2aea1221761f19ffda249337131;p=ceph.git pybind/mgr/restful: use list to pass hooks to create a `Pecan` instance pecan 0.3.2 introduced the new way to pass the hooks to construct a Pecan instance, but the "callable" builder for hooks is not compatible with pecan < 0.3.2. and ubuntu trusty ships pecan 0.3.0, so we need to do this the old way: pass a list of hooks instead of a callable. see https://github.com/pecan/pecan/blame/0.3.2/pecan/core.py and https://github.com/pecan/pecan/commit/fb2cf166aaf5b5af461879ec5b7a46806e8aee45 Fixes: http://tracker.ceph.com/issues/20258 Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index 2b5a761cdfd..2759e96eddb 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -285,7 +285,7 @@ class Module(MgrModule): port=server_port, app=make_app( root='restful.api.Root', - hooks = lambda: [ErrorHook()], + hooks = [ErrorHook()], # use a callable if pecan >= 0.3.2 ), ssl_context=(cert_fname, pkey_fname), )