summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Statistics.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-08-05 17:29:20 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-08-05 17:29:20 +0000
commit9ef9c703159404dba311e18624d2fdd5fb399020 (patch)
treeebd19c69f8b96ca5b3c48444d0194de9815a828c /src/lib/Server/Plugins/Statistics.py
parent3e55be9beb131b33b56985053f05272918ecb4b8 (diff)
downloadbcfg2-9ef9c703159404dba311e18624d2fdd5fb399020.tar.gz
bcfg2-9ef9c703159404dba311e18624d2fdd5fb399020.tar.bz2
bcfg2-9ef9c703159404dba311e18624d2fdd5fb399020.zip
SSHbase: improve tempfile handling (patch from f.pauget) (Resolves Ticket #588)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4854 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Statistics.py')
-rw-r--r--src/lib/Server/Plugins/Statistics.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Statistics.py b/src/lib/Server/Plugins/Statistics.py
index bc6e648bf..41de7ba4b 100644
--- a/src/lib/Server/Plugins/Statistics.py
+++ b/src/lib/Server/Plugins/Statistics.py
@@ -117,4 +117,11 @@ class Statistics(Bcfg2.Server.Plugin.StatisticsPlugin):
def WriteBack(self):
self.data.WriteBack()
+
+ def FindCurrent(self, client):
+ rt = self.data.element.xpath('//Node[@name="%s"]' % client)
+ maxtime = max([time.strptime(stat.get('time')) for stat in rt.findall('Statistics')])
+ return [stat for stat in rt.findall('Statistics') if time.strptime(stat.get('time')) == maxtime][0]
+ def GetExtra(self, client):
+ return [(entry.tag, entry.get('name')) for entry in self.FindCurrent(client).xpath('.//Extra/*')]