diff options
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/Core.py | 10 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/MultiprocessingCore.py | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py index 6357baae4..da278e4ed 100644 --- a/src/lib/Bcfg2/Server/Core.py +++ b/src/lib/Bcfg2/Server/Core.py @@ -973,11 +973,17 @@ class BaseCore(object): raise xmlrpclib.Fault(xmlrpclib.APPLICATION_ERROR, "Critical failure: %s" % message) + def _get_rmi_objects(self): + """ Get a dict (name: object) of all objects that may have RMI + calls. Currently, that includes all plugins and the FAM. """ + rv = {self.fam.__class__.__name__: self.fam} + rv.update(self.plugins) + return rv + def _get_rmi(self): """ Get a list of RMI calls exposed by plugins """ rmi = dict() - for pname, pinst in self.plugins.items() + \ - [(self.fam.__class__.__name__, self.fam)]: + for pname, pinst in self._get_rmi_objects(): for mname in pinst.__rmi__: rmi["%s.%s" % (pname, mname)] = getattr(pinst, mname) return rmi diff --git a/src/lib/Bcfg2/Server/MultiprocessingCore.py b/src/lib/Bcfg2/Server/MultiprocessingCore.py index e79207291..e7518ca18 100644 --- a/src/lib/Bcfg2/Server/MultiprocessingCore.py +++ b/src/lib/Bcfg2/Server/MultiprocessingCore.py @@ -298,8 +298,7 @@ class ChildCore(BaseCore): def _get_rmi(self): rmi = dict() - for pname, pinst in self.plugins.items() + \ - [(self.fam.__class__.__name__, self.fam)]: + for pname, pinst in self._get_rmi_objects(): for crmi in pinst.__child_rmi__: if isinstance(crmi, tuple): mname = crmi[1] @@ -413,8 +412,7 @@ class Core(BuiltinCore): def _get_rmi(self): child_rmi = dict() - for pname, pinst in self.plugins.items() + \ - [(self.fam.__class__.__name__, self.fam)]: + for pname, pinst in self._get_rmi_objects(): for crmi in pinst.__child_rmi__: if isinstance(crmi, tuple): parentname, childname = crmi |