Merge pull request #640 from mwhudson/do-not-count-extended-partitions

do not count extended partition as using space
This commit is contained in:
Michael Hudson-Doyle 2020-02-29 21:03:54 +13:00 committed by GitHub
commit 9e4986b67a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -604,6 +604,8 @@ class _Device(_Formattable, ABC):
return self.size
r = 0
for p in self._partitions:
if p.flag == "extended":
continue
r += p.size
return r
@ -878,6 +880,10 @@ class Partition(_Formattable):
r.append("ESP")
elif self.flag == "bios_grub":
r.append("bios_grub")
elif self.flag == "extended":
r.append("extended")
elif self.flag == "logical":
r.append("logical")
return r
def usage_labels(self):