summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-05 11:29:42 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-06 07:53:40 -0400
commit9b10ec5537630fb38f8ece6de146e1b884b58ddf (patch)
tree038fcf1517c317afceefd37fe5429428b3b8e38d /src/lib/Bcfg2/Server
parentcd7b0b3d40a5a340d5b47819f94a21c9faf23120 (diff)
downloadbcfg2-9b10ec5537630fb38f8ece6de146e1b884b58ddf.tar.gz
bcfg2-9b10ec5537630fb38f8ece6de146e1b884b58ddf.tar.bz2
bcfg2-9b10ec5537630fb38f8ece6de146e1b884b58ddf.zip
improving plugin development docs
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py34
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py2
2 files changed, 20 insertions, 16 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index c6476eb90..80537c200 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -168,9 +168,12 @@ class PluginDatabaseModel(object):
class Generator(object):
- """Generator plugins contribute to literal client configurations."""
+ """Generator plugins contribute to literal client
+ configurations."""
+
def HandlesEntry(self, entry, metadata):
- """This is the slow path method for routing configuration binding requests."""
+ """This is the slow path method for routing configuration
+ binding requests."""
return False
def HandleEntry(self, entry, metadata):
@@ -187,20 +190,21 @@ class Structure(object):
class Metadata(object):
"""Signal metadata capabilities for this plugin"""
- def add_client(self, client_name):
- """Add client."""
- pass
+ def viz(self, hosts, bundles, key, only_client, colors):
+ """Create viz str for viz admin mode."""
+ return ''
- def remove_client(self, client_name):
- """Remove client."""
+ def set_version(self, client, version):
pass
- def viz(self, hosts, bundles, key, colors):
- """Create viz str for viz admin mode."""
+ def set_profile(self, client, profile, address):
pass
- def _handle_default_event(self, event):
- pass
+ def resolve_client(self, address, cleanup_cache=False):
+ return address[1]
+
+ def AuthenticateConnection(self, cert, user, password, address):
+ raise NotImplementedError
def get_initial_metadata(self, client_name):
raise NotImplementedError
@@ -225,13 +229,13 @@ class Connector(object):
class Probing(object):
"""Signal probe capability for this plugin."""
- def GetProbes(self, _):
+ def GetProbes(self, metadata):
"""Return a set of probes for execution on client."""
- return []
+ raise NotImplementedError
- def ReceiveData(self, _, dummy):
+ def ReceiveData(self, metadata, datalist):
"""Receive probe results pertaining to client."""
- pass
+ raise NotImplementedError
class Statistics(Plugin):
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index 056521ce7..fd80cfbe4 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -141,7 +141,7 @@ class ProbeSet(Bcfg2.Server.Plugin.EntrySet):
for (name, entry) in list(build.items()):
probe = lxml.etree.Element('probe')
- probe.set('name', name.split('/')[-1])
+ probe.set('name', os.path.basename(name))
probe.set('source', self.plugin_name)
probe.text = entry.data
match = self.bangline.match(entry.data.split('\n')[0])