Skip to content

Commit

Permalink
simplify partition_by_partuuid
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhudson committed Aug 13, 2023
1 parent 1ab061f commit 92f793e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions subiquity/models/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,15 +1821,7 @@ def all_volgroups(self):
return self._all(type="lvm_volgroup")

def partition_by_partuuid(self, partuuid: str) -> Optional[Partition]:
# This can be simplified when
# https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/448842
# lands.
for part in self.app.base_model.filesystem._all(type="partition"):
if part._info is None:
continue
if part._info.raw.get("ID_PART_ENTRY_UUID") == partuuid:
return part
return None
return self._one(type="partition", uuid=partuuid)

def _remove(self, obj):
_remove_backlinks(obj)
Expand Down

0 comments on commit 92f793e

Please sign in to comment.