summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-01-21 16:56:30 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-01-21 16:56:30 +0000
commita9117a61c0fc1d7341c5276dcdb775eb55818594 (patch)
tree4ea67c3812af7f6663c1ef180d472869d57ad95f
parentf0fdd4a902717c7bfbdd5a636f771fb605cc5f4f (diff)
downloadbcfg2-a9117a61c0fc1d7341c5276dcdb775eb55818594.tar.gz
bcfg2-a9117a61c0fc1d7341c5276dcdb775eb55818594.tar.bz2
bcfg2-a9117a61c0fc1d7341c5276dcdb775eb55818594.zip
Move properties to the connector interface
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5034 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--doc/1.0-roadmap15
-rw-r--r--src/lib/Server/Plugins/Properties.py30
-rw-r--r--src/lib/Server/Plugins/__init__.py6
3 files changed, 46 insertions, 5 deletions
diff --git a/doc/1.0-roadmap b/doc/1.0-roadmap
index 6a7e9e70a..1bd0b9df2 100644
--- a/doc/1.0-roadmap
+++ b/doc/1.0-roadmap
@@ -7,6 +7,7 @@ server.
** Done
*** Build a comprehensive server plugin architecture
*** make out of tree plugins work
+*** properties switch to connector plugin
** Left
*** Version Control Backend
*** Fix the POSIX path problem
@@ -17,9 +18,19 @@ server.
**** Performance
* Other Goals
-** properties switch to connector plugin
** ticket triage
-
** bind failure annotations
** plugin self-bootstrap (get out of bcfg2-admin init)
** core plugin filtering (for bcfg2-admin & co)
+
+* Pie in the sky
+** Rework XMLRPC interfaces
+
+* User visible changes
+** Properties
+*** switched over to a connector interface
+*** now supports multiple file of XML
+*** data available as metadata.Properties[filename]
+** Probes
+*** switched over to a connector interface
+*** data available as metadata.Probes
diff --git a/src/lib/Server/Plugins/Properties.py b/src/lib/Server/Plugins/Properties.py
new file mode 100644
index 000000000..61e80bfe3
--- /dev/null
+++ b/src/lib/Server/Plugins/Properties.py
@@ -0,0 +1,30 @@
+import copy, lxml.etree
+import Bcfg2.Server.Plugin
+
+class Properties(Bcfg2.Server.Plugin.XMLFileBacked):
+ '''Class for properties files'''
+ def Index(self):
+ '''Build data into an xml object'''
+ try:
+ self.data = lxml.etree.XML(self.data)
+ except lxml.etree.XMLSyntaxError:
+ logger.error("Failed to parse %s" % self.name)
+
+class PropDirectoryBacked(Bcfg2.Server.Plugin.DirectoryBacked):
+ __child__ = Properties
+
+class Properties(Bcfg2.Server.Plugin.Plugin,
+ Bcfg2.Server.Plugin.Connector):
+ '''The properties plugin maps property files into client metadata instances'''
+ name = 'Properties'
+ version = '$Revision: $'
+ experimental = True
+
+
+ def __init__(self, core, datastore):
+ Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
+ Bcfg2.Server.Plugin.Connector.__init__(self)
+ self.store = PropDirectoryBacked(self.data, core.fam)
+
+ def get_additional_metadata(self, _):
+ return ((), copy.deepcopy(self.store.entries))
diff --git a/src/lib/Server/Plugins/__init__.py b/src/lib/Server/Plugins/__init__.py
index 8fcb34fc6..1e5c122c8 100644
--- a/src/lib/Server/Plugins/__init__.py
+++ b/src/lib/Server/Plugins/__init__.py
@@ -2,6 +2,6 @@
__revision__ = '$Revision$'
__all__ = ['Account', 'Base', 'Bundler', 'Cfg', 'Decisions', 'GBundler',
- 'Hostbase', 'Metadata', 'NagiosGen', 'Packages', 'Probes',
- 'Pkgmgr', 'Rules', 'SSHbase', 'Statistics', 'Svcmgr', 'TCheetah',
- 'SGenshi', 'TGenshi', 'Vhost']
+ 'Hostbase', 'Metadata', 'NagiosGen', 'Packages', 'Properties',
+ 'Probes', 'Pkgmgr', 'Rules', 'SSHbase', 'Statistics', 'Svcmgr',
+ 'TCheetah', 'SGenshi', 'TGenshi', 'Vhost']