Py34 fixes

This commit is contained in:
Clint Byrum 2015-11-11 15:17:34 -08:00
parent 359e6b8b5f
commit 935f575672
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ def main(argv=None, stdout=None):
stdout.write(content)
stdout.write(b"\n")
if args.output:
with open(args.output, 'w') as output:
with open(args.output, 'wb') as output:
output.write(content)
output.write(b"\n")

View File

@ -96,7 +96,7 @@ class TestCollect(base.TestCase):
collect.main(
['os-collect-counters', '--subunit', '--output', tfile.name],
self.stdout)
content = json.loads(tfile.read())
content = json.loads(tfile.read().decode('utf-8'))
self.assertTrue(isinstance(content, dict))
self.assertIn('mysql', content)
self.assertIn('queues', content)