diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-01-12 01:07:34 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-01-12 01:07:34 +0000 |
commit | 80e4765f7cb7f1ebfa963af653b8e01da3333bd0 (patch) | |
tree | 82e946b7e4a08ae2739acafc5a8708549957c83a /src/lib/Server/Admin | |
parent | 1affc07c26fad2528a5847a77db33a9baabb9fc8 (diff) | |
download | bcfg2-80e4765f7cb7f1ebfa963af653b8e01da3333bd0.tar.gz bcfg2-80e4765f7cb7f1ebfa963af653b8e01da3333bd0.tar.bz2 bcfg2-80e4765f7cb7f1ebfa963af653b8e01da3333bd0.zip |
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
Diffstat (limited to 'src/lib/Server/Admin')
-rw-r--r-- | src/lib/Server/Admin/Pull.py | 16 |
1 files changed, 9 insertions, 7 deletions
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(): |