[blivet] Beware of parted possibly returning unicode objects (#973019)

Vratislav Podzimek vpodzime at redhat.com
Wed Jun 19 11:57:12 UTC 2013


We return plain strings everywhere so we should encode the unicode object with
utf-8 and store it as a plain string.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/devices.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/devices.py b/blivet/devices.py
index 4877a39..6aa6c26 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1374,8 +1374,8 @@ class PartitionDevice(StorageDevice):
         if self.partedPartition is None:
             self._name = self.req_name
         else:
-            self._name = \
-                devicePathToName(self.partedPartition.getDeviceNodeName())
+            dev_node_name = self.partedPartition.getDeviceNodeName()
+            self._name = devicePathToName(dev_node_name.encode("utf-8"))
 
     def dependsOn(self, dep):
         """ Return True if this device depends on dep. """
-- 
1.7.11.7



More information about the anaconda-patches mailing list