diff options
Diffstat (limited to 'src/lib/Server/Plugins/Statistics.py')
-rw-r--r-- | src/lib/Server/Plugins/Statistics.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Statistics.py b/src/lib/Server/Plugins/Statistics.py index 41de7ba4b..b7dc61179 100644 --- a/src/lib/Server/Plugins/Statistics.py +++ b/src/lib/Server/Plugins/Statistics.py @@ -119,9 +119,9 @@ class Statistics(Bcfg2.Server.Plugin.StatisticsPlugin): 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] + rt = self.data.element.xpath('//Node[@name="%s"]' % client)[0] + maxtime = max([strptime(stat.get('time')) for stat in rt.findall('Statistics')]) + return [stat for stat in rt.findall('Statistics') if strptime(stat.get('time')) == maxtime][0] def GetExtra(self, client): return [(entry.tag, entry.get('name')) for entry in self.FindCurrent(client).xpath('.//Extra/*')] |