From 80e4765f7cb7f1ebfa963af653b8e01da3333bd0 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 12 Jan 2009 01:07:34 +0000 Subject: Finish up Pull Source and multi-Statistics code git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5012 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Pull.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lib/Server/Admin/Pull.py') diff --git a/src/lib/Server/Admin/Pull.py b/src/lib/Server/Admin/Pull.py index 2a6432f22..a8113f233 100644 --- a/src/lib/Server/Admin/Pull.py +++ b/src/lib/Server/Admin/Pull.py @@ -26,7 +26,6 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): def __init__(self, configfile): Bcfg2.Server.Admin.MetadataCore.__init__(self, configfile, self.__usage__) - self.stats = self.bcore.stats self.log = False self.mode = 'interactive' @@ -49,12 +48,15 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): def BuildNewEntry(self, client, etype, ename): '''construct a new full entry for given client/entry from statistics''' new_entry = {'type':etype, 'name':ename} - try: - (owner, group, perms, contents) = \ - self.stats.GetCurrentEntry(client, etype, ename) - except Bcfg2.Server.Plugin.PluginExecutionError: - print "Statistics plugin failure; could not fetch current state" - raise SystemExit(1) + for plugin in self.bcore.pull_sources: + try: + (owner, group, perms, contents) = \ + plugin.GetCurrentEntry(client, etype, ename) + break + except Bcfg2.Server.Plugin.PluginExecutionError: + if plugin == self.bcore.pull_sources[-1]: + print "Pull Source failure; could not fetch current state" + raise SystemExit(1) data = {'owner':owner, 'group':group, 'perms':perms, 'text':contents} for k, v in data.iteritems(): -- cgit v1.2.3-1-g7c22