Print partition type in hex in disklabel.py
authorNikos Skalkotos <skalkoto@grnet.gr>
Tue, 4 Mar 2014 13:54:42 +0000 (15:54 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Tue, 4 Mar 2014 14:05:54 +0000 (16:05 +0200)
snf-image-helper/disklabel.py

index d373b3b..6f8ea2b 100755 (executable)
@@ -74,10 +74,12 @@ class MBR(object):
             return struct.calcsize(MBR.Partition.fmt)
 
         def __str__(self):
-            start = self.unpack_chs(self.start)
-            end = self.unpack_chs(self.end)
-            return "%d %s %d %s %d %d" % (self.status, start, self.type, end,
-                                          self.first_sector, self.sector_count)
+            return "%02Xh %s %02Xh %s %d %d" % (self.status,
+                                                self.unpack_chs(self.start),
+                                                self.type,
+                                                self.unpack_chs(self.end),
+                                                self.first_sector,
+                                                self.sector_count)
 
         @staticmethod
         def unpack_chs(chs):