projects
/
snf-image
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c27ba03
)
Print partition type in hex in disklabel.py
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 4 Mar 2014 13:54:42 +0000
(15:54 +0200)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 4 Mar 2014 14:05:54 +0000
(16:05 +0200)
snf-image-helper/disklabel.py
patch
|
blob
|
history
diff --git
a/snf-image-helper/disklabel.py
b/snf-image-helper/disklabel.py
index
d373b3b
..
6f8ea2b
100755
(executable)
--- a/
snf-image-helper/disklabel.py
+++ b/
snf-image-helper/disklabel.py
@@
-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):