summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Probes.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-26 12:47:14 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-26 12:47:14 -0400
commit64eec5fe6a9b640bb77dd65f10f3fac5a586347c (patch)
tree3b3c86bda461ff2232b9f30b0d1e873f2b6a1b9a /src/lib/Bcfg2/Server/Plugins/Probes.py
parent9673ba716310f50855cba74195e53878316af886 (diff)
downloadbcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.gz
bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.bz2
bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.zip
testsuite: fixed issues found by latest version of pep8
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Probes.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index f106b75a4..634826f4b 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -214,10 +214,9 @@ class Probes(Bcfg2.Server.Plugin.Probing,
for group in sorted(self.cgroups[client]):
lxml.etree.SubElement(ctag, "Group", name=group)
try:
- datafile = open(os.path.join(self.data, 'probed.xml'), 'w')
- datafile.write(lxml.etree.tostring(
- top, xml_declaration=False,
- pretty_print='true').decode('UTF-8'))
+ top.getroottree().write(os.path.join(self.data, 'probed.xml'),
+ xml_declaration=False,
+ pretty_print='true')
except IOError:
err = sys.exc_info()[1]
self.logger.error("Failed to write probed.xml: %s" % err)
@@ -246,7 +245,7 @@ class Probes(Bcfg2.Server.Plugin.Probing,
grp.save()
ProbesGroupsModel.objects.filter(
hostname=client.hostname).exclude(
- group__in=self.cgroups[client.hostname]).delete()
+ group__in=self.cgroups[client.hostname]).delete()
def load_data(self):
""" Load probe data from the appropriate backend (probed.xml
@@ -320,7 +319,7 @@ class Probes(Bcfg2.Server.Plugin.Probing,
def ReceiveDataItem(self, client, data, cgroups, cprobedata):
"""Receive probe results pertaining to client."""
- if data.text == None:
+ if data.text is None:
self.logger.info("Got null response to probe %s from %s" %
(data.get('name'), client.hostname))
cprobedata[data.get('name')] = ProbeData('')