]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/restful: use list to pass hooks to create a `Pecan` instance
authorKefu Chai <kchai@redhat.com>
Tue, 13 Jun 2017 02:37:49 +0000 (10:37 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Jun 2017 02:11:01 +0000 (10:11 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/restful/module.py

index 2b5a761cdfd8b82c19e4d973ca7cb08b72e81bd0..2759e96eddbd04b27ea917c4594835b6a8de156d 100644 (file)
@@ -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),
         )