diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-06-09 15:56:41 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-06-09 15:56:41 +0000 |
commit | 34b24211eb8baddec7daf6fa7ecb151fd9aa82e3 (patch) | |
tree | 7935aa537394f32383e026d2e0dead3cad13a30a /src/lib/Server/Plugin.py | |
parent | dc0f82b0b3bce69f9a146126aabf0b2063e64a47 (diff) | |
download | bcfg2-34b24211eb8baddec7daf6fa7ecb151fd9aa82e3.tar.gz bcfg2-34b24211eb8baddec7daf6fa7ecb151fd9aa82e3.tar.bz2 bcfg2-34b24211eb8baddec7daf6fa7ecb151fd9aa82e3.zip |
Change to typed plugin system
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4680 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r-- | src/lib/Server/Plugin.py | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 8c81e5839..6b308d1f7 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -39,6 +39,7 @@ class Plugin(object): __version__ = '$Id$' __author__ = 'bcfg-dev@mcs.anl.gov' __rmi__ = [] + experimental = False def __init__(self, core, datastore): object.__init__(self) @@ -47,18 +48,8 @@ class Plugin(object): self.data = "%s/%s" % (datastore, self.__name__) self.logger = logging.getLogger('Bcfg2.Plugins.%s' % (self.__name__)) - def BuildStructures(self, _): - '''Build a set of structures tailored to the client metadata''' - return [] - - def GetProbes(self, _): - '''Return a set of probes for execution on client''' - return [] - - def ReceiveData(self, _, dummy): - '''Receive probe results pertaining to client''' - pass - +class GeneratorPlugin(Plugin): + '''Generator plugins contribute to literal client configurations''' def HandlesEntry(self, entry): '''This is the slow path method for routing configuration binding requests''' return False @@ -80,6 +71,26 @@ class Plugin(object): # not implemented yet pass +class StructurePlugin(Plugin): + '''Structure Plugins contribute to abstract client configurations''' + def BuildStructures(self, metadata): + '''return a list of abstract goal structures for client''' + raise PluginExecutionError + +class MetadataPlugin(Plugin): + '''Signal metadata capabilities for this plugin''' + pass + +class ProbingPlugin(Plugin): + '''Signal probe capability for this plugin''' + def GetProbes(self, _): + '''Return a set of probes for execution on client''' + return [] + + def ReceiveData(self, _, dummy): + '''Receive probe results pertaining to client''' + pass + # the rest of the file contains classes for coherent file caching class FileBacked(object): @@ -331,7 +342,7 @@ class XMLDirectoryBacked(DirectoryBacked): '''Directorybacked for *.xml''' patterns = re.compile('.*\.xml') -class PrioDir(Plugin, XMLDirectoryBacked): +class PrioDir(GeneratorPlugin, XMLDirectoryBacked): '''This is a generator that handles package assignments''' __name__ = 'PrioDir' __child__ = XMLSrc @@ -602,7 +613,7 @@ class FakeProperties: def __init__(self): self.properties = lxml.etree.Element("Properties") -class GroupSpool(Plugin): +class GroupSpool(GeneratorPlugin): '''The TGenshi generator implements a templating mechanism for configuration files''' __name__ = 'GroupSpool' __version__ = '$Id$' |