From 4bb58ec3525ac58b9cda6f42df1a46af25361b92 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sat, 10 Jan 2009 18:31:28 +0000 Subject: Finish up PullSource plugin work git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5010 ce84e21b-d406-0410-9b95-82705330c041 --- doc/plugin-roles | 19 +++++++++++++------ src/lib/Server/Admin/Pull.py | 7 +++++-- src/lib/Server/Plugins/Cfg.py | 3 ++- src/lib/Server/Plugins/SSHbase.py | 3 ++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/doc/plugin-roles b/doc/plugin-roles index 8941bd6cc..5552c0545 100644 --- a/doc/plugin-roles +++ b/doc/plugin-roles @@ -6,15 +6,15 @@ This documents available plugin roles. |---------------+--------------------+---------------| | Metadata | Metadata | done | | Connector | Connector | done | -| Generator | Generator | done | -| Structure | Structure | done | -| Pull | PullSource | class defined | | Probing | Probing | done | -| Decision | Decision | done | -| Remote | Remote | none | -| Statistics | Statistics | class defined | +| Structure | Structure | done | | Structure Val | StructureValidator | done | +| Generator | Generator | done | | Goals Val | GoalValidator | done | +| Statistics | Statistics | class defined | +| Pull | PullSource | done | +| Decision | Decision | done | +| Remote | Remote | none | | Syncing | Syncing | none | |---------------+--------------------+---------------| @@ -27,6 +27,13 @@ This documents available plugin roles. ** Introspection interface (for bcfg2-info & co) * Connector ** Provide additional data for ClientMetadata instances +* Probing +* Structure +* Structure Validation +* Generator +* Goals Validation +* Pull +* Decision 3) Configuration of plugins diff --git a/src/lib/Server/Admin/Pull.py b/src/lib/Server/Admin/Pull.py index ecf86787e..60f528c1d 100644 --- a/src/lib/Server/Admin/Pull.py +++ b/src/lib/Server/Admin/Pull.py @@ -96,8 +96,11 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): ename in gen.Entries.get(etype, {})] if len(glist) != 1: self.errExit("Got wrong numbers of matching generators for entry:" \ - + "%s" % ([g.__name__ for g in glist])) + + "%s" % ([g.name for g in glist])) plugin = glist[0] + if not isinstance(plugin, Bcfg2.Server.Plugin.PullSource): + self.errExit("Configuration upload not supported by plugin %s" \ + % (plugin.name)) try: choices = plugin.AcceptChoices(new_entry, meta) specific = self.Choose(choices) @@ -105,5 +108,5 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): plugin.AcceptPullData(specific, new_entry, self.log) except Bcfg2.Server.Plugin.PluginExecutionError: self.errExit("Configuration upload not supported by plugin %s" \ - % (plugin.__name__)) + % (plugin.name)) # FIXME svn commit if running under svn diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py index 02d912206..9bf1ed4bd 100644 --- a/src/lib/Server/Plugins/Cfg.py +++ b/src/lib/Server/Plugins/Cfg.py @@ -125,7 +125,8 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet): if log: logger.info("Wrote file %s" % infofile.name) -class Cfg(Bcfg2.Server.Plugin.GroupSpool): +class Cfg(Bcfg2.Server.Plugin.GroupSpool, + Bcfg2.Server.Plugin.PullSource): '''This generator in the configuration file repository for bcfg2''' name = 'Cfg' __version__ = '$Id$' diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py index e3e0f739b..40f2cb721 100644 --- a/src/lib/Server/Plugins/SSHbase.py +++ b/src/lib/Server/Plugins/SSHbase.py @@ -6,7 +6,8 @@ import Bcfg2.Server.Plugin class SSHbase(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Generator, - Bcfg2.Server.Plugin.DirectoryBacked): + Bcfg2.Server.Plugin.DirectoryBacked, + Bcfg2.Server.Plugin.PullSource): '''The sshbase generator manages ssh host keys (both v1 and v2) for hosts. It also manages the ssh_known_hosts file. It can integrate host keys from other management domains and similarly -- cgit v1.2.3-1-g7c22