mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-12-16 23:00:23 +00:00
Fix sectors/bytes type problem with single partition
This commit is contained in:
parent
f43e2480a5
commit
16eaade09a
4 changed files with 6 additions and 6 deletions
|
|
@ -38,7 +38,7 @@ class AbstractPartitionMap(FSMProxy):
|
||||||
"""Returns the total size the partitions occupy
|
"""Returns the total size the partitions occupy
|
||||||
|
|
||||||
:return: The size of all partitions
|
:return: The size of all partitions
|
||||||
:rtype: Bytes
|
:rtype: Sectors
|
||||||
"""
|
"""
|
||||||
# We just need the endpoint of the last partition
|
# We just need the endpoint of the last partition
|
||||||
return self.partitions[-1].get_end()
|
return self.partitions[-1].get_end()
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class AbstractPartition(FSMProxy):
|
||||||
"""Gets the end of the partition
|
"""Gets the end of the partition
|
||||||
|
|
||||||
:return: The end of the partition
|
:return: The end of the partition
|
||||||
:rtype: Bytes
|
:rtype: Sectors
|
||||||
"""
|
"""
|
||||||
return self.get_start() + self.size
|
return self.get_start() + self.size
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class BasePartition(AbstractPartition):
|
||||||
"""Gets the starting byte of this partition
|
"""Gets the starting byte of this partition
|
||||||
|
|
||||||
:return: The starting byte of this partition
|
:return: The starting byte of this partition
|
||||||
:rtype: Bytes
|
:rtype: Sectors
|
||||||
"""
|
"""
|
||||||
if self.previous is None:
|
if self.previous is None:
|
||||||
# If there is no previous partition, this partition begins at the offset
|
# If there is no previous partition, this partition begins at the offset
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ class SinglePartition(AbstractPartition):
|
||||||
"""Gets the starting byte of this partition
|
"""Gets the starting byte of this partition
|
||||||
|
|
||||||
:return: The starting byte of this partition
|
:return: The starting byte of this partition
|
||||||
:rtype: Bytes
|
:rtype: Sectors
|
||||||
"""
|
"""
|
||||||
from bootstrapvz.common.bytes import Bytes
|
from bootstrapvz.common.sectors import Sectors
|
||||||
# On an unpartitioned volume there is no offset and no previous partition
|
# On an unpartitioned volume there is no offset and no previous partition
|
||||||
return Bytes(0)
|
return Sectors(0, self.size.sector_size)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue