From fde846836107c325bcaa055cfe2545d35827d897 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 8 Oct 2008 17:56:34 +0000 Subject: server infrastructure for central decision lists git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4932 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-server | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-server') diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 9dc40f333..08e3f3d87 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -76,7 +76,8 @@ class Bcfg2Serv(Bcfg2.Component.Component): "GetConfig" : self.Bcfg2GetConfig, "GetProbes" : self.Bcfg2GetProbes, "RecvProbeData" : self.Bcfg2RecvProbeData, - "RecvStats" : self.Bcfg2RecvStats + "RecvStats" : self.Bcfg2RecvStats, + "GetDecisionList" : self.Bcfg2GetDecisionList }) @@ -188,6 +189,18 @@ class Bcfg2Serv(Bcfg2.Component.Component): def _authenticate_connection(self, _, user, password, address): return self.Core.metadata.AuthenticateConnection(user, password, address) + def Bcfg2GetDecisionList(self, address, mode): + client = self.Core.metadata.resolve_client(address) + meta = self.Core.metadata.get_metadata(client) + result = [] + for plugin in self.Core.plugins.values(): + try: + if isinstance(plugin, Bcfg2.Server.Plugin.DecisionPlugin): + result += plugin.GetDecision(meta, mode) + except: + self.logger.error("Plugin: %s failed to generate decision list" % plugin.__name__) + return [] + if __name__ == '__main__': OPTINFO = { -- cgit v1.2.3-1-g7c22