From 53cdb607bc9204b69d3f1aac42baea5ddcb94c12 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 7 Feb 2021 13:36:30 +0100 Subject: Added the ability to check if a harddrive has any mountpoint related to a given parameter. --- archinstall/lib/disk.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'archinstall/lib/disk.py') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 1d78d127..aafb07a8 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -103,6 +103,12 @@ class BlockDevice(): def has_partitions(self): return len(self.partitions) + def has_mount_point(self, mountpoint): + for partition in self.partitions: + if self.partitions[partition].mountpoint == mountpoint: + return True + return False + class Partition(): def __init__(self, path, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False): -- cgit v1.2.3-54-g00ecf