diff options
author | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2007-06-06 15:16:02 +0000 |
---|---|---|
committer | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2007-06-06 15:16:02 +0000 |
commit | aa0e3dbb9aa5d8fbf018aee0717faadde3370725 (patch) | |
tree | 249bf471da57c209cac069bbf3d5f9b23c4c904d /src/lib/Server | |
parent | ec8b235b87d1cf59f149d42b8032604ce04f3d77 (diff) | |
download | bcfg2-aa0e3dbb9aa5d8fbf018aee0717faadde3370725.tar.gz bcfg2-aa0e3dbb9aa5d8fbf018aee0717faadde3370725.tar.bz2 bcfg2-aa0e3dbb9aa5d8fbf018aee0717faadde3370725.zip |
Statistics retention policy bugfix (forgot an import)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3250 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Statistics.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/Server/Statistics.py b/src/lib/Server/Statistics.py index 3dd275a89..968b75e47 100644 --- a/src/lib/Server/Statistics.py +++ b/src/lib/Server/Statistics.py @@ -2,7 +2,7 @@ __revision__ = '$Revision$' from lxml.etree import XML, SubElement, Element, XMLSyntaxError -from time import asctime, localtime, time, strptime +from time import asctime, localtime, time, strptime, mktime import logging, lxml.etree, os @@ -74,13 +74,11 @@ class Statistics(object): elif nummatch == 1 and not node_dirty: # Delete old instance node = nodes[0] - for elem in [elem for elem in node.findall('Statistics') if self.isOlderThan24h(elem.get('time'))]: - node.remove(elem) + [node.remove(elem) for elem in node.findall('Statistics') if self.isOlderThan24h(elem.get('time'))] elif nummatch == 1 and node_dirty: # Delete old dirty statistics entry node = nodes[0] - for elem in [elem for elem in node.findall('Statistics') if (elem.get('state') == 'dirty' and self.isOlderThan24h(elem.get('time')))]: - node.remove(elem) + [node.remove(elem) for elem in node.findall('Statistics') if (elem.get('state') == 'dirty' and self.isOlderThan24h(elem.get('time')))] else: # Shouldn't be reached self.logger.error("Duplicate node entry for %s"%(client)) |