summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Statistics.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-04-11 17:54:33 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-04-11 17:54:33 +0000
commit81e1c4d0d0ca6208ba58b695d3a5ca456b793bb4 (patch)
tree3dc67bab73db8645767ce1bae7fa54e0fd522783 /src/lib/Server/Statistics.py
parent1a3293fe116478c1b120e04394f0d6d6aae9307d (diff)
downloadbcfg2-81e1c4d0d0ca6208ba58b695d3a5ca456b793bb4.tar.gz
bcfg2-81e1c4d0d0ca6208ba58b695d3a5ca456b793bb4.tar.bz2
bcfg2-81e1c4d0d0ca6208ba58b695d3a5ca456b793bb4.zip
pylint fixes
(Logical change 1.220) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@925 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Statistics.py')
-rw-r--r--src/lib/Server/Statistics.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Server/Statistics.py b/src/lib/Server/Statistics.py
index 10223acfb..d623b1e89 100644
--- a/src/lib/Server/Statistics.py
+++ b/src/lib/Server/Statistics.py
@@ -3,7 +3,7 @@ __revision__ = '$Revision: $'
from elementtree.ElementTree import XML, SubElement, Element
from xml.parsers.expat import ExpatError
-from syslog import syslog, LOG_INFO, LOG_ERR
+from syslog import syslog, LOG_ERR
from time import asctime, localtime, time
class Statistics(object):
@@ -21,15 +21,15 @@ class Statistics(object):
'''Produce a pretty-printed text representation of element'''
if element.text:
fmt = "%s<%%s %%s>%%s</%%s>" % (level*" ")
- data = (element.tag, (" ".join(["%s='%s'" % x for x in element.attrib.iteritems()])),
+ data = (element.tag, (" ".join(["%s='%s'" % keyval for keyval in element.attrib.iteritems()])),
element.text, element.tag)
if element._children:
fmt = "%s<%%s %%s>\n" % (level*" ",) + (len(element._children) * "%s") + "%s</%%s>\n" % (level*" ")
- data = (element.tag, ) + (" ".join(["%s='%s'" % x for x in element.attrib.iteritems()]),)
- data += tuple([self.pretty_print(x, level+2) for x in element._children]) + (element.tag, )
+ data = (element.tag, ) + (" ".join(["%s='%s'" % keyval for keyval in element.attrib.iteritems()]),)
+ data += tuple([self.pretty_print(entry, level+2) for entry in element._children]) + (element.tag, )
else:
fmt = "%s<%%s %%s/>\n" % (level * " ")
- data = (element.tag, " ".join(["%s='%s'" % x for x in element.attrib.iteritems()]))
+ data = (element.tag, " ".join(["%s='%s'" % keyval for keyval in element.attrib.iteritems()]))
return fmt % data
def WriteBack(self, force=0):
@@ -76,15 +76,15 @@ class Statistics(object):
# The following list comprehension should be guarenteed to return at
# most one result
nodes = [elem for elem in self.element.findall('Node') if elem.get('name') == client]
- nl = len(nodes)
- if nl == 0:
+ nummatch = len(nodes)
+ if nummatch == 0:
# Create an entry for this node
node = SubElement(self.element, 'Node', name=client)
- elif nl == 1 and not node_dirty:
+ elif nummatch == 1 and not node_dirty:
# Delete old instance
self.element.remove(nodes[0])
node = SubElement(self.element, 'Node', name=client)
- elif nl == 1 and node_dirty:
+ 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']: