From e4056a7923dd607521d97763d5dfb6de8a33ab5d Mon Sep 17 00:00:00 2001 From: Igor Kalnitsky Date: Fri, 23 Oct 2015 15:00:51 +0300 Subject: [PATCH] Pass unicode to io.open We must pass unicode objects (unicode in py2, str in py3) to io.open, otherwise it would fail with: TypeError: can't write str to text stream Change-Id: I9d2ba46ae6b967feb64fe180f9a6ce85918b0791 Closes-Bug: #1509325 --- fuel_agent/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuel_agent/manager.py b/fuel_agent/manager.py index 10cdd8b..16da523 100644 --- a/fuel_agent/manager.py +++ b/fuel_agent/manager.py @@ -529,10 +529,10 @@ class Manager(object): # a corresponding file system will never be checked. We assume # puppet or other configuration tool will care of it. if fs.mount == '/': - f.write('UUID=%s %s %s defaults,errors=panic 0 0\n' % + f.write(u'UUID=%s %s %s defaults,errors=panic 0 0\n' % (mount2uuid[fs.mount], fs.mount, fs.type)) else: - f.write('UUID=%s %s %s defaults 0 0\n' % + f.write(u'UUID=%s %s %s defaults 0 0\n' % (mount2uuid[fs.mount], fs.mount, fs.type)) self.umount_target(chroot)