From: Ernesto Puerta Date: Thu, 10 Oct 2019 09:17:43 +0000 (+0200) Subject: mgr/dashboard: add new interfaces to plugin X-Git-Tag: v15.1.0~1274^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e58bcc4a414eb4385fe3de668e1694f39c72b4f7;p=ceph-ci.git mgr/dashboard: add new interfaces to plugin New plugin Mixins (`CanCherrypy`) and Interfaces (`Initializable`, `ConfiguresCherryPy`) have been added to plugin interfaces. Fixes: https://tracker.ceph.com/issues/41990 Signed-off-by: Ernesto Puerta --- diff --git a/src/pybind/mgr/dashboard/plugins/interfaces.py b/src/pybind/mgr/dashboard/plugins/interfaces.py index 3ef41fd3312..ce449acfe01 100644 --- a/src/pybind/mgr/dashboard/plugins/interfaces.py +++ b/src/pybind/mgr/dashboard/plugins/interfaces.py @@ -1,19 +1,34 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -from . import PLUGIN_MANAGER as PM, Interface # pylint: disable=cyclic-import +from . import PLUGIN_MANAGER as PM, Interface, Mixin # pylint: disable=cyclic-import -class CanMgr(Interface): +class CanMgr(Mixin): from .. import mgr mgr = mgr -class CanLog(Interface): +class CanLog(Mixin): from .. import logger log = logger +class CanCherrypy(Mixin): + import cherrypy + request = cherrypy.request + response = cherrypy.response + + +@PM.add_interface +class Initializable(Interface): + @PM.add_abcspec + def init(self): + """ + Placeholder for module scope initialization + """ + + @PM.add_interface class Setupable(Interface): @PM.add_abcspec @@ -45,6 +60,13 @@ class HasControllers(Interface): pass +@PM.add_interface +class ConfiguresCherryPy(Interface): + @PM.add_abcspec + def configure_cherrypy(self, config): + pass + + class FilterRequest(object): @PM.add_interface class BeforeHandler(Interface):