py3 file write compatible

This commit is contained in:
Timur Torubarov 2016-12-12 10:37:27 +03:00
parent fa8ebc7154
commit 7c739661fb

View File

@ -129,7 +129,7 @@ class Plugin(AbstractPlugin):
# dump config contents into a file
xmlfile = self.core.mkstemp(".xml", "monitoring_")
self.core.add_artifact_file(xmlfile)
with open(xmlfile, "w") as f:
with open(xmlfile, "wb") as f: # output file should be in binary mode to support py3
f.write(config_contents)
self.config = xmlfile