summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2011-06-13 15:23:54 -0400
committerLuke Macken <lmacken@redhat.com>2011-06-13 15:23:54 -0400
commite701dd8917e0b14f228f647ef1d88bfb95a3006b (patch)
treec165c70724427aa35df2485906b9de14cc159bf8
parent0338c182773d65b2f3b65dc4fb40d4fe8094efc8 (diff)
Make our get_mbr method handle devices without any partitions
-rwxr-xr-xliveusb/creator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 52390cc..2891896 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -845,7 +845,10 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
self.popen('mkfs.vfat -F 32 %s' % self._drive)
def get_mbr(self):
- parent = str(self.drive.get('parent', self._drive))
+ parent = self.drive.get('parent', self._drive)
+ if parent is None:
+ parent = self._drive
+ parent = str(parent)
self.log.debug('Checking the MBR of %s' % parent)
drive = open(parent, 'rb')
mbr = ''.join(['%02X' % ord(x) for x in drive.read(2)])