]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: add new interfaces to plugin
authorErnesto Puerta <epuertat@redhat.com>
Thu, 10 Oct 2019 09:17:43 +0000 (11:17 +0200)
committerErnesto Puerta <epuertat@redhat.com>
Mon, 28 Oct 2019 10:21:20 +0000 (11:21 +0100)
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 <epuertat@redhat.com>
(cherry picked from commit e58bcc4a414eb4385fe3de668e1694f39c72b4f7)

Conflicts:
src/pybind/mgr/dashboard/plugins/interfaces.py

src/pybind/mgr/dashboard/plugins/interfaces.py

index e990b5abce92f052e45faee35ca3b0475fa9cab1..ade05e62f642df1aef8c77b0f518fc7e4d9cc7ef 100644 (file)
@@ -1,19 +1,34 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from . import PLUGIN_MANAGER as PM, Interface
+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
@@ -43,7 +58,14 @@ class HasControllers(Interface):
     def get_controllers(self): pass
 
 
-class FilterRequest:
+@PM.add_interface
+class ConfiguresCherryPy(Interface):
+    @PM.add_abcspec
+    def configure_cherrypy(self, config):
+        pass
+
+
+class FilterRequest(object):
     @PM.add_interface
     class BeforeHandler(Interface):
         @PM.add_abcspec