summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-10-08 17:56:34 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-10-08 17:56:34 +0000
commitfde846836107c325bcaa055cfe2545d35827d897 (patch)
treebaa51fb6d716f872582ef05f85018e73f796e10d /src
parent66faa8ba82f6ef2c7916c2f0c9f1b4b1a7f78a7b (diff)
downloadbcfg2-fde846836107c325bcaa055cfe2545d35827d897.tar.gz
bcfg2-fde846836107c325bcaa055cfe2545d35827d897.tar.bz2
bcfg2-fde846836107c325bcaa055cfe2545d35827d897.zip
server infrastructure for central decision lists
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4932 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugin.py5
-rwxr-xr-xsrc/sbin/bcfg2-server15
2 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 6e3bc3a7c..9424e085f 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -113,6 +113,11 @@ class StatisticsPlugin(Plugin):
def GetCurrentEntry(self, client, e_type, e_name):
raise PluginExecutionError
+class DecisionPlugin(Plugin):
+ '''Signal decision handling capability'''
+ def GetDecisions(self, metadata, mode):
+ return []
+
# the rest of the file contains classes for coherent file caching
class FileBacked(object):
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 = {