summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-01-10 18:31:28 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-01-10 18:31:28 +0000
commit4bb58ec3525ac58b9cda6f42df1a46af25361b92 (patch)
treeb86eeba184da4eb77fc73ef1459bfb338946b359 /src
parente5a25e5f5170ba06d5482877b57df132d0df465f (diff)
downloadbcfg2-4bb58ec3525ac58b9cda6f42df1a46af25361b92.tar.gz
bcfg2-4bb58ec3525ac58b9cda6f42df1a46af25361b92.tar.bz2
bcfg2-4bb58ec3525ac58b9cda6f42df1a46af25361b92.zip
Finish up PullSource plugin work
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5010 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Pull.py7
-rw-r--r--src/lib/Server/Plugins/Cfg.py3
-rw-r--r--src/lib/Server/Plugins/SSHbase.py3
3 files changed, 9 insertions, 4 deletions
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