summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Core.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-01-05 03:24:50 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-01-05 03:24:50 +0000
commita9388f7859586d5d98e815efdcf8d6a85b973bef (patch)
tree8adaf09fbd9cc5d4e3cd0dbf69ebcaade4577f76 /src/lib/Server/Core.py
parentd3f79b55f57787a75773459dbc70a5504c7ddcf3 (diff)
downloadbcfg2-a9388f7859586d5d98e815efdcf8d6a85b973bef.tar.gz
bcfg2-a9388f7859586d5d98e815efdcf8d6a85b973bef.tar.bz2
bcfg2-a9388f7859586d5d98e815efdcf8d6a85b973bef.zip
This patch is stage 1 of the plugin capabilities rework
- define new plugin base classes - switch Plugin.__name__ => Plugin.name git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5004 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Core.py')
-rw-r--r--src/lib/Server/Core.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 3c8a8c429..d4f9b9f6e 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -63,7 +63,7 @@ class Core(object):
while True:
try:
plugin = chk_plugins.pop()
- if isinstance(plugin, Bcfg2.Server.Plugin.MetadataPlugin):
+ if isinstance(plugin, Bcfg2.Server.Plugin.Metadata):
self.metadata = plugin
break
except:
@@ -77,7 +77,7 @@ class Core(object):
while True:
try:
plugin = chk_plugins.pop()
- if isinstance(plugin, Bcfg2.Server.Plugin.StatisticsPlugin):
+ if isinstance(plugin, Bcfg2.Server.Plugin.Statistics):
self.stats = plugin
break
except:
@@ -88,11 +88,11 @@ class Core(object):
break
for plug_names, plug_tname, plug_type, collection in \
- [(structures, 'structure', Bcfg2.Server.Plugin.StructurePlugin,
+ [(structures, 'structure', Bcfg2.Server.Plugin.Structure,
self.structures),
- (generators, 'generator', Bcfg2.Server.Plugin.GeneratorPlugin,
+ (generators, 'generator', Bcfg2.Server.Plugin.Generator,
self.generators),
- (connectors, 'connector', Bcfg2.Server.Plugin.MetadataConnectorPlugin,
+ (connectors, 'connector', Bcfg2.Server.Plugin.Connector,
self.connectors),
]:
for plugin in plug_names:
@@ -170,7 +170,7 @@ class Core(object):
if len(glist) == 1:
return glist[0].Entries[entry.tag][entry.get('name')](entry, metadata)
elif len(glist) > 1:
- generators = ", ".join([gen.__name__ for gen in glist])
+ generators = ", ".join([gen.name for gen in glist])
logger.error("%s %s served by multiple generators: %s" % \
(entry.tag, entry.get('name'), generators))
g2list = [gen for gen in self.generators if gen.HandlesEntry(entry)]
@@ -246,17 +246,16 @@ class Core(object):
result = []
for plugin in self.plugins.values():
try:
- if isinstance(plugin, Bcfg2.Server.Plugin.DecisionPlugin):
+ if isinstance(plugin, Bcfg2.Server.Plugin.Decision):
result += plugin.GetDecisions(metadata, mode)
except:
- logger.error("Plugin: %s failed to generate decision list" % plugin.__name__, exc_info=1)
+ logger.error("Plugin: %s failed to generate decision list" % plugin.name, exc_info=1)
return result
def build_metadata(self, client_name):
imd = self.metadata.get_initial_metadata(client_name)
for conn in self.connectors:
grps, data = conn.get_additional_metadata(imd)
- self.metadata.merge_additional_metadata(imd, conn.__name__,
- grps, data)
+ self.metadata.merge_additional_metadata(imd, conn.name, grps, data)
return imd