summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Probes.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-06-14 15:23:31 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-06-14 15:23:31 -0500
commitb1ab3e2bab9f07c13daf5dcfd4a9502eb84dcf0d (patch)
treeea17ecbdf858a28520e9e86ece2ef68483be64ab /src/lib/Server/Plugins/Probes.py
parent2c9a76cdfcce02f8d89129405f1f477753c47d3c (diff)
downloadbcfg2-b1ab3e2bab9f07c13daf5dcfd4a9502eb84dcf0d.tar.gz
bcfg2-b1ab3e2bab9f07c13daf5dcfd4a9502eb84dcf0d.tar.bz2
bcfg2-b1ab3e2bab9f07c13daf5dcfd4a9502eb84dcf0d.zip
PY3K: Finish server-side code fixes
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Plugins/Probes.py')
-rw-r--r--src/lib/Server/Plugins/Probes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Probes.py b/src/lib/Server/Plugins/Probes.py
index ea2e79ccc..3599f2af1 100644
--- a/src/lib/Server/Plugins/Probes.py
+++ b/src/lib/Server/Plugins/Probes.py
@@ -1,4 +1,5 @@
import lxml.etree
+import operator
import re
import Bcfg2.Server.Plugin
@@ -27,7 +28,7 @@ class ProbeSet(Bcfg2.Server.Plugin.EntrySet):
ret = []
build = dict()
candidates = self.get_matching(metadata)
- candidates.sort(lambda x, y: cmp(x.specific, y.specific))
+ candidates.sort(key=operator.attrgetter('specific'))
for entry in candidates:
rem = specific_probe_matcher.match(entry.name)
if not rem:
@@ -90,7 +91,7 @@ class Probes(Bcfg2.Server.Plugin.Plugin,
datafile = open("%s/%s" % (self.data, 'probed.xml'), 'w')
except IOError:
self.logger.error("Failed to write probed.xml")
- datafile.write(data)
+ datafile.write(data.decode('utf-8'))
def load_data(self):
try: